forked from TrueCloudLab/frostfs-contract
[TrueCloudLab#3] container: Rename neofs to frostfs
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
4052e4873b
commit
9c004cab2e
4 changed files with 15 additions and 15 deletions
|
@ -1,4 +1,4 @@
|
||||||
name: "NeoFS Container"
|
name: "FrostFS Container"
|
||||||
safemethods: ["count", "get", "owner", "list", "eACL", "getContainerSize", "listContainerSizes", "version"]
|
safemethods: ["count", "get", "owner", "list", "eACL", "getContainerSize", "listContainerSizes", "version"]
|
||||||
permissions:
|
permissions:
|
||||||
- methods: ["update", "addKey", "transferX",
|
- methods: ["update", "addKey", "transferX",
|
||||||
|
|
|
@ -44,7 +44,7 @@ type (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
neofsIDContractKey = "identityScriptHash"
|
frostfsIDContractKey = "identityScriptHash"
|
||||||
balanceContractKey = "balanceScriptHash"
|
balanceContractKey = "balanceScriptHash"
|
||||||
netmapContractKey = "netmapScriptHash"
|
netmapContractKey = "netmapScriptHash"
|
||||||
nnsContractKey = "nnsScriptHash"
|
nnsContractKey = "nnsScriptHash"
|
||||||
|
@ -113,7 +113,7 @@ func _deploy(data interface{}, isUpdate bool) {
|
||||||
|
|
||||||
storage.Put(ctx, netmapContractKey, args.addrNetmap)
|
storage.Put(ctx, netmapContractKey, args.addrNetmap)
|
||||||
storage.Put(ctx, balanceContractKey, args.addrBalance)
|
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, nnsContractKey, args.addrNNS)
|
||||||
storage.Put(ctx, nnsRootKey, args.nnsRoot)
|
storage.Put(ctx, nnsRootKey, args.nnsRoot)
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ func PutNamed(container []byte, signature interop.Signature,
|
||||||
|
|
||||||
ownerID := ownerFromBinaryContainer(container)
|
ownerID := ownerFromBinaryContainer(container)
|
||||||
containerID := crypto.Sha256(container)
|
containerID := crypto.Sha256(container)
|
||||||
neofsIDContractAddr := storage.Get(ctx, neofsIDContractKey).(interop.Hash160)
|
frostfsIDContractAddr := storage.Get(ctx, frostfsIDContractKey).(interop.Hash160)
|
||||||
cnr := Container{
|
cnr := Container{
|
||||||
value: container,
|
value: container,
|
||||||
sig: signature,
|
sig: signature,
|
||||||
|
@ -272,7 +272,7 @@ func PutNamed(container []byte, signature interop.Signature,
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(token) == 0 { // if container created directly without session
|
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")
|
runtime.Log("added new container")
|
||||||
|
|
|
@ -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
|
Container contract stores and manages containers, extended ACLs and container
|
||||||
size estimations. Contract does not perform sanity or signature checks of
|
size estimations. Contract does not perform sanity or signature checks of
|
||||||
|
|
|
@ -31,7 +31,7 @@ func deployContainerContract(t *testing.T, e *neotest.Executor, addrNetmap, addr
|
||||||
args[2] = addrBalance
|
args[2] = addrBalance
|
||||||
args[3] = util.Uint160{} // not needed for now
|
args[3] = util.Uint160{} // not needed for now
|
||||||
args[4] = addrNNS
|
args[4] = addrNNS
|
||||||
args[5] = "neofs"
|
args[5] = "frostfs"
|
||||||
|
|
||||||
c := neotest.CompileFile(t, e.CommitteeHash, containerPath, path.Join(containerPath, "config.yml"))
|
c := neotest.CompileFile(t, e.CommitteeHash, containerPath, path.Join(containerPath, "config.yml"))
|
||||||
e.DeployContract(t, c, args)
|
e.DeployContract(t, c, args)
|
||||||
|
@ -146,14 +146,14 @@ func TestContainerPut(t *testing.T) {
|
||||||
stackitem.NewByteArray([]byte(base58.Encode(cnt.id[:]))),
|
stackitem.NewByteArray([]byte(base58.Encode(cnt.id[:]))),
|
||||||
})
|
})
|
||||||
cNNS := c.CommitteeInvoker(nnsHash)
|
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) {
|
t.Run("name is already taken", func(t *testing.T) {
|
||||||
c.InvokeFail(t, "name is already taken", "putNamed", putArgs...)
|
c.InvokeFail(t, "name is already taken", "putNamed", putArgs...)
|
||||||
})
|
})
|
||||||
|
|
||||||
c.Invoke(t, stackitem.Null{}, "delete", cnt.id[:], cnt.sig, cnt.token)
|
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) {
|
t.Run("register in advance", func(t *testing.T) {
|
||||||
cnt.value[len(cnt.value)-1] = 10
|
cnt.value[len(cnt.value)-1] = 10
|
||||||
|
|
Loading…
Reference in a new issue