core: remove nnsrecords package from native

Use nns from examples instead.
This commit is contained in:
Anna Shaleva 2021-05-17 21:10:09 +03:00
parent c9099fa555
commit 2d20b0fa23
5 changed files with 86 additions and 98 deletions

View file

@ -6,8 +6,8 @@ import (
"errors"
"fmt"
nns "github.com/nspcc-dev/neo-go/examples/nft-nd-nns"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/core/native/nnsrecords"
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
@ -64,8 +64,8 @@ func (c *Client) GetDesignatedByRole(role noderoles.Role, index uint32) (keys.Pu
}
// NNSResolve invokes `resolve` method on a NameService contract with the specified hash.
func (c *Client) NNSResolve(nnsHash util.Uint160, name string, typ nnsrecords.Type) (string, error) {
if typ == nnsrecords.CNAME {
func (c *Client) NNSResolve(nnsHash util.Uint160, name string, typ nns.RecordType) (string, error) {
if typ == nns.CNAME {
return "", errors.New("can't resolve CNAME record type")
}
result, err := c.InvokeFunction(nnsHash, "resolve", []smartcontract.Parameter{