Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NNS contract #266

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nns/nns_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ func DeleteRecords(name string, typ RecordType) {
// Resolve resolves given name (not more then three redirects are allowed).
func Resolve(name string, typ RecordType) []string {
ctx := storage.GetReadOnlyContext()
return resolve(ctx, nil, name, typ, 2)
res := []string{}
return resolve(ctx, res, name, typ, 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better unwrap compatibility? nspcc-dev/neo-go#2795, maybe?

}

// GetAllRecords returns an Iterator with RecordState items for the given name.
Expand Down
2 changes: 1 addition & 1 deletion tests/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func TestContainerPut(t *testing.T) {
})

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.NewArray([]stackitem.Item{}), "resolve", "mycnt.neofs", int64(nns.TXT))

t.Run("register in advance", func(t *testing.T) {
cnt.value[len(cnt.value)-1] = 10
Expand Down
2 changes: 2 additions & 0 deletions tests/nns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,6 @@ func TestNNSResolve(t *testing.T) {
c.Invoke(t, records, "resolve", "test.com", int64(nns.TXT))
c.Invoke(t, records, "resolve", "test.com.", int64(nns.TXT))
c.InvokeFail(t, "invalid domain name format", "resolve", "test.com..", int64(nns.TXT))
// Empty result.
c.Invoke(t, stackitem.NewArray([]stackitem.Item{}), "resolve", "test.com", int64(nns.CNAME))
}