From 9c004cab2ef7fcda5a33d38b52c82d0bbd2ca4cd Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 11 Jan 2023 10:49:28 +0300 Subject: [PATCH] [TrueCloudLab#3] container: Rename neofs to frostfs Signed-off-by: Denis Kirillov --- container/config.yml | 2 +- container/container_contract.go | 20 ++++++++++---------- container/doc.go | 2 +- tests/container_test.go | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/container/config.yml b/container/config.yml index 71f47f5..dfe3e65 100644 --- a/container/config.yml +++ b/container/config.yml @@ -1,4 +1,4 @@ -name: "NeoFS Container" +name: "FrostFS Container" safemethods: ["count", "get", "owner", "list", "eACL", "getContainerSize", "listContainerSizes", "version"] permissions: - methods: ["update", "addKey", "transferX", diff --git a/container/container_contract.go b/container/container_contract.go index 1f773f3..a807cee 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -44,13 +44,13 @@ type ( ) const ( - neofsIDContractKey = "identityScriptHash" - balanceContractKey = "balanceScriptHash" - netmapContractKey = "netmapScriptHash" - nnsContractKey = "nnsScriptHash" - nnsRootKey = "nnsRoot" - nnsHasAliasKey = "nnsHasAlias" - notaryDisabledKey = "notary" + frostfsIDContractKey = "identityScriptHash" + balanceContractKey = "balanceScriptHash" + netmapContractKey = "netmapScriptHash" + nnsContractKey = "nnsScriptHash" + nnsRootKey = "nnsRoot" + nnsHasAliasKey = "nnsHasAlias" + notaryDisabledKey = "notary" // RegistrationFeeKey is a key in netmap config which contains fee for container registration. RegistrationFeeKey = "ContainerFee" @@ -113,7 +113,7 @@ func _deploy(data interface{}, isUpdate bool) { storage.Put(ctx, netmapContractKey, args.addrNetmap) storage.Put(ctx, balanceContractKey, args.addrBalance) - storage.Put(ctx, neofsIDContractKey, args.addrID) + storage.Put(ctx, frostfsIDContractKey, args.addrID) storage.Put(ctx, nnsContractKey, args.addrNNS) storage.Put(ctx, nnsRootKey, args.nnsRoot) @@ -179,7 +179,7 @@ func PutNamed(container []byte, signature interop.Signature, ownerID := ownerFromBinaryContainer(container) containerID := crypto.Sha256(container) - neofsIDContractAddr := storage.Get(ctx, neofsIDContractKey).(interop.Hash160) + frostfsIDContractAddr := storage.Get(ctx, frostfsIDContractKey).(interop.Hash160) cnr := Container{ value: container, sig: signature, @@ -272,7 +272,7 @@ func PutNamed(container []byte, signature interop.Signature, } if len(token) == 0 { // if container created directly without session - contract.Call(neofsIDContractAddr, "addKey", contract.All, ownerID, [][]byte{publicKey}) + contract.Call(frostfsIDContractAddr, "addKey", contract.All, ownerID, [][]byte{publicKey}) } runtime.Log("added new container") diff --git a/container/doc.go b/container/doc.go index f2319ac..0636b0f 100644 --- a/container/doc.go +++ b/container/doc.go @@ -1,5 +1,5 @@ /* -Container contract is a contract deployed in NeoFS sidechain. +Container contract is a contract deployed in FrostFS sidechain. Container contract stores and manages containers, extended ACLs and container size estimations. Contract does not perform sanity or signature checks of diff --git a/tests/container_test.go b/tests/container_test.go index 6892d99..56d7cef 100644 --- a/tests/container_test.go +++ b/tests/container_test.go @@ -31,7 +31,7 @@ func deployContainerContract(t *testing.T, e *neotest.Executor, addrNetmap, addr args[2] = addrBalance args[3] = util.Uint160{} // not needed for now args[4] = addrNNS - args[5] = "neofs" + args[5] = "frostfs" c := neotest.CompileFile(t, e.CommitteeHash, containerPath, path.Join(containerPath, "config.yml")) e.DeployContract(t, c, args) @@ -146,14 +146,14 @@ func TestContainerPut(t *testing.T) { stackitem.NewByteArray([]byte(base58.Encode(cnt.id[:]))), }) cNNS := c.CommitteeInvoker(nnsHash) - cNNS.Invoke(t, expected, "resolve", "mycnt.neofs", int64(nns.TXT)) + cNNS.Invoke(t, expected, "resolve", "mycnt.frostfs", int64(nns.TXT)) t.Run("name is already taken", func(t *testing.T) { c.InvokeFail(t, "name is already taken", "putNamed", putArgs...) }) c.Invoke(t, stackitem.Null{}, "delete", cnt.id[:], cnt.sig, cnt.token) - cNNS.Invoke(t, stackitem.Null{}, "resolve", "mycnt.neofs", int64(nns.TXT)) + cNNS.Invoke(t, stackitem.Null{}, "resolve", "mycnt.frostfs", int64(nns.TXT)) t.Run("register in advance", func(t *testing.T) { cnt.value[len(cnt.value)-1] = 10