From 3c7a9cb74379081a094f7806843d56205d69d95d Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Thu, 12 Dec 2024 13:18:44 +0300 Subject: [PATCH] [#136] container/test: Move container domain to constant Signed-off-by: Alexander Chuprov --- tests/container_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/container_test.go b/tests/container_test.go index d57003f..0847663 100644 --- a/tests/container_test.go +++ b/tests/container_test.go @@ -28,13 +28,17 @@ const ( containerAliasFee = 0o_0050_0000 ) +const ( + containerRootDomain = "frostfs" +) + func deployContainerContract(t *testing.T, e *neotest.Executor, addrNetmap, addrBalance, addrNNS util.Uint160) util.Uint160 { args := make([]any, 5) args[0] = addrNetmap args[1] = addrBalance args[2] = util.Uint160{} // not needed for now args[3] = addrNNS - args[4] = "frostfs" + args[4] = containerRootDomain c := neotest.CompileFile(t, e.CommitteeHash, containerPath, path.Join(containerPath, "config.yml")) e.DeployContract(t, c, args) @@ -207,14 +211,14 @@ func TestContainerPut(t *testing.T) { stackitem.NewByteArray([]byte(base58.Encode(cnt.id[:]))), }) cNNS := c.CommitteeInvoker(nnsHash) - cNNS.Invoke(t, expected, "resolve", "mycnt.frostfs", int64(nns.TXT)) + cNNS.Invoke(t, expected, "resolve", "mycnt."+containerRootDomain, 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.pub, cnt.token) - cNNS.Invoke(t, stackitem.Null{}, "resolve", "mycnt.frostfs", int64(nns.TXT)) + cNNS.Invoke(t, stackitem.Null{}, "resolve", "mycnt."+containerRootDomain, int64(nns.TXT)) t.Run("register in advance", func(t *testing.T) { cnt.value[len(cnt.value)-1] = 10 @@ -246,9 +250,9 @@ func TestContainerPut(t *testing.T) { nnsInv := c.NewInvoker(ctrNNS.Hash, acc) containerInv := c.WithSigners(c.Committee, acc) - nnsInv.InvokeFail(t, "not witnessed by admin", "addRecord", "frostfs", int64(nns.TXT), nns.Cnametgt+"=animals") + nnsInv.InvokeFail(t, "not witnessed by admin", "addRecord", containerRootDomain, int64(nns.TXT), nns.Cnametgt+"=animals") containerInv.Invoke(t, stackitem.Null{}, "setAdmin", acc.ScriptHash()) - nnsInv.Invoke(t, stackitem.Null{}, "addRecord", "frostfs", int64(nns.TXT), nns.Cnametgt+"=animals") + nnsInv.Invoke(t, stackitem.Null{}, "addRecord", containerRootDomain, int64(nns.TXT), nns.Cnametgt+"=animals") }) t.Run("create global domain", func(t *testing.T) {