forked from TrueCloudLab/frostfs-contract
Compare commits
3 commits
feat/add_s
...
master
Author | SHA1 | Date | |
---|---|---|---|
201db45bd7 | |||
e002a1fa80 | |||
31709a3d95 |
4 changed files with 12 additions and 4 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
v0.21.0
|
v0.21.1
|
||||||
|
|
|
@ -5,14 +5,14 @@ import "github.com/nspcc-dev/neo-go/pkg/interop/native/std"
|
||||||
const (
|
const (
|
||||||
major = 0
|
major = 0
|
||||||
minor = 21
|
minor = 21
|
||||||
patch = 0
|
patch = 1
|
||||||
|
|
||||||
// Versions from which an update should be performed.
|
// Versions from which an update should be performed.
|
||||||
// These should be used in a group (so prevMinor can be equal to minor if there are
|
// These should be used in a group (so prevMinor can be equal to minor if there are
|
||||||
// any migration routines.
|
// any migration routines.
|
||||||
prevMajor = 0
|
prevMajor = 0
|
||||||
prevMinor = 20
|
prevMinor = 19
|
||||||
prevPatch = 0
|
prevPatch = 4
|
||||||
|
|
||||||
Version = major*1_000_000 + minor*1_000 + patch
|
Version = major*1_000_000 + minor*1_000 + patch
|
||||||
|
|
||||||
|
|
|
@ -401,6 +401,7 @@ func DeleteSubject(addr interop.Hash160) {
|
||||||
storage.Delete(ctx, subjectAdditionalKey(subj.AdditionalKeys[i], addr))
|
storage.Delete(ctx, subjectAdditionalKey(subj.AdditionalKeys[i], addr))
|
||||||
storage.Delete(ctx, addressKey(contract.CreateStandardAccount(subj.AdditionalKeys[i])))
|
storage.Delete(ctx, addressKey(contract.CreateStandardAccount(subj.AdditionalKeys[i])))
|
||||||
}
|
}
|
||||||
|
storage.Delete(ctx, addressKey(addr))
|
||||||
storage.Delete(ctx, sKey)
|
storage.Delete(ctx, sKey)
|
||||||
|
|
||||||
removeSubjectFromNamespace(ctx, subj.Namespace, addr)
|
removeSubjectFromNamespace(ctx, subj.Namespace, addr)
|
||||||
|
|
|
@ -629,6 +629,9 @@ func TestAdditionalKeyFromPrimarySubject(t *testing.T) {
|
||||||
subjDPrimaryKey, err := keys.NewPrivateKey()
|
subjDPrimaryKey, err := keys.NewPrivateKey()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
subjFPrimaryKey, err := keys.NewPrivateKey()
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
invoker.Invoke(t, stackitem.Null{}, createSubjectMethod, defaultNamespace, subjAPrimaryKey.PublicKey().Bytes())
|
invoker.Invoke(t, stackitem.Null{}, createSubjectMethod, defaultNamespace, subjAPrimaryKey.PublicKey().Bytes())
|
||||||
|
|
||||||
invoker.Invoke(t, stackitem.Null{}, createSubjectMethod, defaultNamespace, subjBPrimaryKey.PublicKey().Bytes())
|
invoker.Invoke(t, stackitem.Null{}, createSubjectMethod, defaultNamespace, subjBPrimaryKey.PublicKey().Bytes())
|
||||||
|
@ -647,6 +650,10 @@ func TestAdditionalKeyFromPrimarySubject(t *testing.T) {
|
||||||
invoker.InvokeFail(t, "key is occupied", addSubjectKeyMethod, subjAKeyAddr, subjDPrimaryKey.PublicKey().Bytes())
|
invoker.InvokeFail(t, "key is occupied", addSubjectKeyMethod, subjAKeyAddr, subjDPrimaryKey.PublicKey().Bytes())
|
||||||
invoker.Invoke(t, stackitem.Null{}, deleteSubjectMethod, subjBKeyAddr)
|
invoker.Invoke(t, stackitem.Null{}, deleteSubjectMethod, subjBKeyAddr)
|
||||||
invoker.Invoke(t, stackitem.Null{}, addSubjectKeyMethod, subjAKeyAddr, subjDPrimaryKey.PublicKey().Bytes())
|
invoker.Invoke(t, stackitem.Null{}, addSubjectKeyMethod, subjAKeyAddr, subjDPrimaryKey.PublicKey().Bytes())
|
||||||
|
|
||||||
|
invoker.Invoke(t, stackitem.Null{}, createSubjectMethod, defaultNamespace, subjFPrimaryKey.PublicKey().Bytes())
|
||||||
|
invoker.Invoke(t, stackitem.Null{}, deleteSubjectMethod, subjFPrimaryKey.PublicKey().GetScriptHash())
|
||||||
|
invoker.Invoke(t, stackitem.Null{}, createSubjectMethod, defaultNamespace, subjFPrimaryKey.PublicKey().Bytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkPublicKeyResult(t *testing.T, s *vm.Stack, err error, key *keys.PrivateKey) {
|
func checkPublicKeyResult(t *testing.T, s *vm.Stack, err error, key *keys.PrivateKey) {
|
||||||
|
|
Loading…
Reference in a new issue