diff --git a/frostfsid/frostfsid_contract.go b/frostfsid/frostfsid_contract.go index f53bfb2..98f6fdc 100644 --- a/frostfsid/frostfsid_contract.go +++ b/frostfsid/frostfsid_contract.go @@ -930,6 +930,7 @@ func subjectAdditionalPrefix(additionalKey interop.PublicKey) []byte { func namespaceKey(ns string) []byte { return namespaceKeyFromHash(ripemd160Hash(ns)) } + func namespaceKeyFromHash(ns []byte) []byte { return append([]byte{namespaceKeysPrefix}, ns...) } diff --git a/tests/frostfsid_test.go b/tests/frostfsid_test.go index 92bbb4a..7a7e23d 100644 --- a/tests/frostfsid_test.go +++ b/tests/frostfsid_test.go @@ -254,7 +254,6 @@ func TestFrostFSID_SubjectManagement(t *testing.T) { require.NoError(t, err) require.Len(t, addresses, 2) require.ElementsMatch(t, addresses, []util.Uint160{subjKeyAddr, newSubjKey.PublicKey().GetScriptHash()}) - }) anonInvoker.InvokeFail(t, notWitnessedError, deleteSubjectMethod, subjKeyAddr) @@ -359,7 +358,6 @@ func TestFrostFSIS_GroupNameRelatedInvariants(t *testing.T) { invoker.InvokeFail(t, "not available", createGroupMethod, ns1, groupName2) invoker.Invoke(t, stackitem.Make(3), createGroupMethod, ns2, groupName2) - // Check that we cannot find group id by name for group that was removed invoker.Invoke(t, stackitem.Null{}, deleteGroupMethod, ns1, groupID2) s, err = invoker.TestInvoke(t, getGroupIDByNameMethod, ns1, groupName2) @@ -369,7 +367,7 @@ func TestFrostFSIS_GroupNameRelatedInvariants(t *testing.T) { invoker.Invoke(t, stackitem.Make(4), createGroupMethod, ns1, groupName2) // Check that after group renaming its id cannot be found by old name - newGroupName:= "new" + newGroupName := "new" invoker.Invoke(t, stackitem.Null{}, setGroupNameMethod, ns1, groupID1, newGroupName) s, err = invoker.TestInvoke(t, getGroupIDByNameMethod, ns1, groupName1) checkGroupIDResult(t, s, err, -1)