[#1] tests: Update domain email after rebranding

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
Alexey Vanin 2023-05-17 10:51:39 +03:00
parent e11dfc84af
commit 9b81572b9d

View file

@ -30,7 +30,7 @@ func newNNSInvoker(t *testing.T, addRoot bool) *neotest.ContractInvoker {
refresh, retry, expire, ttl := int64(101), int64(102), int64(msPerYear/1000*100), int64(104) refresh, retry, expire, ttl := int64(101), int64(102), int64(msPerYear/1000*100), int64(104)
c.Invoke(t, true, "register", c.Invoke(t, true, "register",
"com", c.CommitteeHash, "com", c.CommitteeHash,
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
} }
return c return c
} }
@ -50,21 +50,21 @@ func TestNNSRegisterTLD(t *testing.T) {
c.InvokeFail(t, "invalid domain name format", "register", c.InvokeFail(t, "invalid domain name format", "register",
"0com", c.CommitteeHash, "0com", c.CommitteeHash,
"email@nspcc.ru", refresh, retry, expire, ttl) "email@frostfs.info", refresh, retry, expire, ttl)
acc := c.NewAccount(t) acc := c.NewAccount(t)
cAcc := c.WithSigners(acc) cAcc := c.WithSigners(acc)
cAcc.InvokeFail(t, "not witnessed by committee", "register", cAcc.InvokeFail(t, "not witnessed by committee", "register",
"com", acc.ScriptHash(), "com", acc.ScriptHash(),
"email@nspcc.ru", refresh, retry, expire, ttl) "email@frostfs.info", refresh, retry, expire, ttl)
c.Invoke(t, true, "register", c.Invoke(t, true, "register",
"com", c.CommitteeHash, "com", c.CommitteeHash,
"email@nspcc.ru", refresh, retry, expire, ttl) "email@frostfs.info", refresh, retry, expire, ttl)
c.InvokeFail(t, "TLD already exists", "register", c.InvokeFail(t, "TLD already exists", "register",
"com", c.CommitteeHash, "com", c.CommitteeHash,
"email@nspcc.ru", refresh, retry, expire, ttl) "email@frostfs.info", refresh, retry, expire, ttl)
} }
func TestNNSRegister(t *testing.T) { func TestNNSRegister(t *testing.T) {
@ -75,33 +75,33 @@ func TestNNSRegister(t *testing.T) {
c1 := c.WithSigners(c.Committee, accTop) c1 := c.WithSigners(c.Committee, accTop)
c1.Invoke(t, true, "register", c1.Invoke(t, true, "register",
"com", accTop.ScriptHash(), "com", accTop.ScriptHash(),
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
acc := c.NewAccount(t) acc := c.NewAccount(t)
c2 := c.WithSigners(c.Committee, acc) c2 := c.WithSigners(c.Committee, acc)
c2.InvokeFail(t, "not witnessed by admin", "register", c2.InvokeFail(t, "not witnessed by admin", "register",
"testdomain.com", acc.ScriptHash(), "testdomain.com", acc.ScriptHash(),
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
c3 := c.WithSigners(accTop, acc) c3 := c.WithSigners(accTop, acc)
t.Run("domain names with hyphen", func(t *testing.T) { t.Run("domain names with hyphen", func(t *testing.T) {
c3.InvokeFail(t, "invalid domain name format", "register", c3.InvokeFail(t, "invalid domain name format", "register",
"-testdomain.com", acc.ScriptHash(), "-testdomain.com", acc.ScriptHash(),
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
c3.InvokeFail(t, "invalid domain name format", "register", c3.InvokeFail(t, "invalid domain name format", "register",
"testdomain-.com", acc.ScriptHash(), "testdomain-.com", acc.ScriptHash(),
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
c3.Invoke(t, true, "register", c3.Invoke(t, true, "register",
"test-domain.com", acc.ScriptHash(), "test-domain.com", acc.ScriptHash(),
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
}) })
c3.Invoke(t, true, "register", c3.Invoke(t, true, "register",
"testdomain.com", acc.ScriptHash(), "testdomain.com", acc.ScriptHash(),
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
b := c.TopBlock(t) b := c.TopBlock(t)
expected := stackitem.NewArray([]stackitem.Item{stackitem.NewBuffer( expected := stackitem.NewArray([]stackitem.Item{stackitem.NewBuffer(
[]byte(fmt.Sprintf("testdomain.com myemail@nspcc.ru %d %d %d %d %d", []byte(fmt.Sprintf("testdomain.com myemail@frostfs.info %d %d %d %d %d",
b.Timestamp, refresh, retry, expire, ttl)))}) b.Timestamp, refresh, retry, expire, ttl)))})
c.Invoke(t, expected, "getRecords", "testdomain.com", int64(nns.SOA)) c.Invoke(t, expected, "getRecords", "testdomain.com", int64(nns.SOA))
@ -195,18 +195,18 @@ func TestNNSUpdateSOA(t *testing.T) {
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104) refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
c.Invoke(t, true, "register", c.Invoke(t, true, "register",
"testdomain.com", c.CommitteeHash, "testdomain.com", c.CommitteeHash,
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
refresh *= 2 refresh *= 2
retry *= 2 retry *= 2
expire *= 2 expire *= 2
ttl *= 2 ttl *= 2
c.Invoke(t, stackitem.Null{}, "updateSOA", c.Invoke(t, stackitem.Null{}, "updateSOA",
"testdomain.com", "newemail@nspcc.ru", refresh, retry, expire, ttl) "testdomain.com", "newemail@frostfs.info", refresh, retry, expire, ttl)
b := c.TopBlock(t) b := c.TopBlock(t)
expected := stackitem.NewArray([]stackitem.Item{stackitem.NewBuffer( expected := stackitem.NewArray([]stackitem.Item{stackitem.NewBuffer(
[]byte(fmt.Sprintf("testdomain.com newemail@nspcc.ru %d %d %d %d %d", []byte(fmt.Sprintf("testdomain.com newemail@frostfs.info %d %d %d %d %d",
b.Timestamp, refresh, retry, expire, ttl)))}) b.Timestamp, refresh, retry, expire, ttl)))})
c.Invoke(t, expected, "getRecords", "testdomain.com", int64(nns.SOA)) c.Invoke(t, expected, "getRecords", "testdomain.com", int64(nns.SOA))
} }
@ -217,13 +217,13 @@ func TestNNSGetAllRecords(t *testing.T) {
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104) refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
c.Invoke(t, true, "register", c.Invoke(t, true, "register",
"testdomain.com", c.CommitteeHash, "testdomain.com", c.CommitteeHash,
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
c.Invoke(t, stackitem.Null{}, "addRecord", "testdomain.com", int64(nns.TXT), "first TXT record") c.Invoke(t, stackitem.Null{}, "addRecord", "testdomain.com", int64(nns.TXT), "first TXT record")
c.Invoke(t, stackitem.Null{}, "addRecord", "testdomain.com", int64(nns.A), "1.2.3.4") c.Invoke(t, stackitem.Null{}, "addRecord", "testdomain.com", int64(nns.A), "1.2.3.4")
b := c.TopBlock(t) b := c.TopBlock(t)
expSOA := fmt.Sprintf("testdomain.com myemail@nspcc.ru %d %d %d %d %d", expSOA := fmt.Sprintf("testdomain.com myemail@frostfs.info %d %d %d %d %d",
b.Timestamp, refresh, retry, expire, ttl) b.Timestamp, refresh, retry, expire, ttl)
s, err := c.TestInvoke(t, "getAllRecords", "testdomain.com") s, err := c.TestInvoke(t, "getAllRecords", "testdomain.com")
@ -257,7 +257,7 @@ func TestExpiration(t *testing.T) {
refresh, retry, expire, ttl := int64(101), int64(102), int64(msPerYear/1000*10), int64(104) refresh, retry, expire, ttl := int64(101), int64(102), int64(msPerYear/1000*10), int64(104)
c.Invoke(t, true, "register", c.Invoke(t, true, "register",
"testdomain.com", c.CommitteeHash, "testdomain.com", c.CommitteeHash,
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
checkProperties := func(t *testing.T, expiration uint64) { checkProperties := func(t *testing.T, expiration uint64) {
expected := stackitem.NewMapWithValue([]stackitem.MapElement{ expected := stackitem.NewMapWithValue([]stackitem.MapElement{
@ -295,7 +295,7 @@ func TestNNSSetAdmin(t *testing.T) {
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104) refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
c.Invoke(t, true, "register", c.Invoke(t, true, "register",
"testdomain.com", c.CommitteeHash, "testdomain.com", c.CommitteeHash,
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
acc := c.NewAccount(t) acc := c.NewAccount(t)
cAcc := c.WithSigners(acc) cAcc := c.WithSigners(acc)
@ -318,7 +318,7 @@ func TestNNSIsAvailable(t *testing.T) {
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104) refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
c.Invoke(t, true, "register", c.Invoke(t, true, "register",
"com", c.CommitteeHash, "com", c.CommitteeHash,
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
c.Invoke(t, false, "isAvailable", "com") c.Invoke(t, false, "isAvailable", "com")
c.Invoke(t, true, "isAvailable", "domain.com") c.Invoke(t, true, "isAvailable", "domain.com")
@ -327,7 +327,7 @@ func TestNNSIsAvailable(t *testing.T) {
c1 := c.WithSigners(c.Committee, acc) c1 := c.WithSigners(c.Committee, acc)
c1.Invoke(t, true, "register", c1.Invoke(t, true, "register",
"domain.com", acc.ScriptHash(), "domain.com", acc.ScriptHash(),
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
c.Invoke(t, false, "isAvailable", "domain.com") c.Invoke(t, false, "isAvailable", "domain.com")
} }
@ -340,7 +340,7 @@ func TestNNSRenew(t *testing.T) {
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104) refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
c1.Invoke(t, true, "register", c1.Invoke(t, true, "register",
"testdomain.com", c.CommitteeHash, "testdomain.com", c.CommitteeHash,
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
const msPerYear = 365 * 24 * time.Hour / time.Millisecond const msPerYear = 365 * 24 * time.Hour / time.Millisecond
b := c.TopBlock(t) b := c.TopBlock(t)
@ -361,7 +361,7 @@ func TestNNSResolve(t *testing.T) {
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104) refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
c.Invoke(t, true, "register", c.Invoke(t, true, "register",
"test.com", c.CommitteeHash, "test.com", c.CommitteeHash,
"myemail@nspcc.ru", refresh, retry, expire, ttl) "myemail@frostfs.info", refresh, retry, expire, ttl)
c.Invoke(t, stackitem.Null{}, "addRecord", c.Invoke(t, stackitem.Null{}, "addRecord",
"test.com", int64(nns.TXT), "expected result") "test.com", int64(nns.TXT), "expected result")