forked from nspcc-dev/neofs-contract
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nspcc-dev#266] nns: Add
admin
to properties
Follow the https://github.com/neo-project/non-native-contracts/blob/14f43ba8cf169323b61c23a3a701ac77d9a4e3eb/src/NameService/NameService.cs#L69. Signed-off-by: Anna Shaleva <[email protected]>
- Loading branch information
1 parent
70ae2c9
commit 9e96dc4
Showing
2 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,7 +262,8 @@ func TestExpiration(t *testing.T) { | |
checkProperties := func(t *testing.T, expiration uint64) { | ||
expected := stackitem.NewMapWithValue([]stackitem.MapElement{ | ||
{Key: stackitem.Make("name"), Value: stackitem.Make("testdomain.com")}, | ||
{Key: stackitem.Make("expiration"), Value: stackitem.Make(expiration)}}) | ||
{Key: stackitem.Make("expiration"), Value: stackitem.Make(expiration)}, | ||
{Key: stackitem.Make("admin"), Value: stackitem.Null{}}}) | ||
s, err := c.TestInvoke(t, "properties", "testdomain.com") | ||
require.NoError(t, err) | ||
require.Equal(t, expected.Value(), s.Top().Item().Value()) | ||
|
@@ -296,6 +297,7 @@ func TestNNSSetAdmin(t *testing.T) { | |
c.Invoke(t, true, "register", | ||
"testdomain.com", c.CommitteeHash, | ||
"[email protected]", refresh, retry, expire, ttl) | ||
top := c.TopBlock(t) | ||
|
||
acc := c.NewAccount(t) | ||
cAcc := c.WithSigners(acc) | ||
|
@@ -305,6 +307,13 @@ func TestNNSSetAdmin(t *testing.T) { | |
c1 := c.WithSigners(c.Committee, acc) | ||
c1.Invoke(t, stackitem.Null{}, "setAdmin", "testdomain.com", acc.ScriptHash()) | ||
|
||
expiration := top.Timestamp + uint64(expire*1000) | ||
expectedProps := stackitem.NewMapWithValue([]stackitem.MapElement{ | ||
{Key: stackitem.Make("name"), Value: stackitem.Make("testdomain.com")}, | ||
{Key: stackitem.Make("expiration"), Value: stackitem.Make(expiration)}, | ||
{Key: stackitem.Make("admin"), Value: stackitem.Make(acc.ScriptHash().BytesBE())}}) | ||
cAcc.Invoke(t, expectedProps, "properties", "testdomain.com") | ||
|
||
cAcc.Invoke(t, stackitem.Null{}, "addRecord", | ||
"testdomain.com", int64(nns.TXT), "will be added") | ||
} | ||
|
@@ -351,7 +360,8 @@ func TestNNSRenew(t *testing.T) { | |
c1.Invoke(t, ts, "renew", "testdomain.com") | ||
expected := stackitem.NewMapWithValue([]stackitem.MapElement{ | ||
{Key: stackitem.Make("name"), Value: stackitem.Make("testdomain.com")}, | ||
{Key: stackitem.Make("expiration"), Value: stackitem.Make(ts)}}) | ||
{Key: stackitem.Make("expiration"), Value: stackitem.Make(ts)}, | ||
{Key: stackitem.Make("admin"), Value: stackitem.Null{}}}) | ||
cAcc.Invoke(t, expected, "properties", "testdomain.com") | ||
} | ||
|
||
|