From a1c9871d953a1d6f5f80a6dee5fc0d95bc799bc0 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 7 Sep 2022 16:41:31 +0300 Subject: [PATCH] nns: it's NEP-11, so make NEP-11 methods available too --- pkg/rpcclient/nns/contract.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/rpcclient/nns/contract.go b/pkg/rpcclient/nns/contract.go index b358a818c..f51294be7 100644 --- a/pkg/rpcclient/nns/contract.go +++ b/pkg/rpcclient/nns/contract.go @@ -12,6 +12,7 @@ import ( "github.com/google/uuid" "github.com/nspcc-dev/neo-go/pkg/neorpc/result" + "github.com/nspcc-dev/neo-go/pkg/rpcclient/nep11" "github.com/nspcc-dev/neo-go/pkg/rpcclient/unwrap" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" @@ -19,14 +20,13 @@ import ( // Invoker is used by ContractReader to call various methods. type Invoker interface { - Call(contract util.Uint160, operation string, params ...interface{}) (*result.Invoke, error) - CallAndExpandIterator(contract util.Uint160, method string, maxItems int, params ...interface{}) (*result.Invoke, error) - TerminateSession(sessionID uuid.UUID) error - TraverseIterator(sessionID uuid.UUID, iterator *result.Iterator, num int) ([]stackitem.Item, error) + nep11.Invoker } // ContractReader provides an interface to call read-only NNS contract methods. type ContractReader struct { + nep11.NonDivisibleReader + invoker Invoker hash util.Uint160 } @@ -41,7 +41,7 @@ type RecordIterator struct { // NewReader creates an instance of ContractReader that can be used to read // data from the contract. func NewReader(invoker Invoker, hash util.Uint160) *ContractReader { - return &ContractReader{invoker, hash} + return &ContractReader{*nep11.NewNonDivisibleReader(invoker, hash), invoker, hash} } // GetPrice returns current domain registration price in GAS.