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: Return empty Array from getRecords instead of Null
And adjust method usages along the way. Signed-off-by: Anna Shaleva <[email protected]>
- Loading branch information
1 parent
72e0695
commit ae237ff
Showing
3 changed files
with
23 additions
and
6 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
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 |
---|---|---|
|
@@ -251,6 +251,23 @@ func TestNNSGetAllRecords(t *testing.T) { | |
require.False(t, iter.Next()) | ||
} | ||
|
||
func TestNNSGetRecords(t *testing.T) { | ||
c := newNNSInvoker(t, true) | ||
|
||
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104) | ||
c.Invoke(t, true, "register", | ||
"testdomain.com", c.CommitteeHash, | ||
"[email protected]", refresh, retry, expire, ttl) | ||
|
||
txtData := "first TXT record" | ||
c.Invoke(t, stackitem.Null{}, "addRecord", "testdomain.com", int64(nns.TXT), txtData) | ||
c.Invoke(t, stackitem.Null{}, "addRecord", "testdomain.com", int64(nns.A), "1.2.3.4") | ||
|
||
c.Invoke(t, stackitem.NewArray([]stackitem.Item{stackitem.Make(txtData)}), "getRecords", "testdomain.com", int64(nns.TXT)) | ||
// Check empty result. | ||
c.Invoke(t, stackitem.NewArray([]stackitem.Item{}), "getRecords", "testdomain.com", int64(nns.AAAA)) | ||
} | ||
|
||
func TestExpiration(t *testing.T) { | ||
c := newNNSInvoker(t, true) | ||
|
||
|