diff --git a/frostfsid/frostfsid_contract.go b/frostfsid/frostfsid_contract.go index 2b48d95..1167041 100644 --- a/frostfsid/frostfsid_contract.go +++ b/frostfsid/frostfsid_contract.go @@ -107,6 +107,8 @@ const ( nsPurgeState = "purge" ) +var dummyValue = []byte{1} + func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() @@ -168,7 +170,7 @@ func _deploy(data any, isUpdate bool) { subject := std.Deserialize(iterator.Value(it).([]byte)).(Subject) subjAddr := contract.CreateStandardAccount(subject.PrimaryKey) for i := 0; i < len(subject.AdditionalKeys); i++ { - storage.Put(ctx, subjectToAdditionalKeyKey(subjAddr, subject.AdditionalKeys[i]), []byte{1}) + storage.Put(ctx, subjectToAdditionalKeyKey(subjAddr, subject.AdditionalKeys[i]), dummyValue) } subject.AdditionalKeys = nil storage.Put(ctx, subjectKeyFromAddr(subjAddr), std.Serialize(subject)) @@ -268,7 +270,7 @@ func CreateSubject(ns string, key interop.PublicKey) { storage.Put(ctx, sKey, std.Serialize(subj)) nsSubjKey := namespaceSubjectKey(ns, addr) - storage.Put(ctx, nsSubjKey, []byte{1}) + storage.Put(ctx, nsSubjKey, dummyValue) storage.Put(ctx, allAddressKey, true) runtime.Notify("CreateSubject", interop.Hash160(addr)) @@ -297,7 +299,7 @@ func AddSubjectKey(addr interop.Hash160, key interop.PublicKey) { panic("key already added") } - storage.Put(ctx, saKey, []byte{1}) + storage.Put(ctx, saKey, dummyValue) sKey := subjectKeyFromAddr(addr) data = storage.Get(ctx, sKey).([]byte) @@ -307,7 +309,7 @@ func AddSubjectKey(addr interop.Hash160, key interop.PublicKey) { subject := std.Deserialize(data).(Subject) checkNamespaceState(subject.Namespace) - storage.Put(ctx, subjectToAdditionalKeyKey(addr, key), []byte{1}) + storage.Put(ctx, subjectToAdditionalKeyKey(addr, key), dummyValue) storage.Put(ctx, addressKey, true) runtime.Notify("AddSubjectKey", addr, key) } @@ -938,7 +940,7 @@ func AddSubjectToGroup(addr interop.Hash160, groupID int) { } gsKey := groupSubjectKey(subject.Namespace, groupID, addr) - storage.Put(ctx, gsKey, []byte{1}) + storage.Put(ctx, gsKey, dummyValue) runtime.Notify("AddSubjectToGroup", addr, subject.Namespace, groupID) }