diff --git a/cli/smartcontract/testdata/nameservice/nns.go b/cli/smartcontract/testdata/nameservice/nns.go index 2b19af793..4c3a76d6f 100644 --- a/cli/smartcontract/testdata/nameservice/nns.go +++ b/cli/smartcontract/testdata/nameservice/nns.go @@ -13,6 +13,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" "math/big" + "unicode/utf8" ) // Hash contains contract hash. diff --git a/cli/smartcontract/testdata/notifications/rpcbindings.out b/cli/smartcontract/testdata/notifications/rpcbindings.out index aeeb3ccd7..a3717edd8 100644 --- a/cli/smartcontract/testdata/notifications/rpcbindings.out +++ b/cli/smartcontract/testdata/notifications/rpcbindings.out @@ -11,6 +11,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" "math/big" + "unicode/utf8" ) // Hash contains contract hash. diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index 6a711921a..eac2bdced 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -347,8 +347,6 @@ func CompileAndSave(src string, o *Options) ([]byte, error) { eStructName := rpcbinding.ToEventBindingName(e.Name) for _, p := range e.Parameters { pStructName := rpcbinding.ToParameterBindingName(p.Name) - // TODO: proper imports handling during bindings generation (see utf8 example). - // Probably, we should always add p type to the list of types. if p.ExtendedType != nil { pName := eStructName + "." + pStructName cfg.Types[pName] = *p.ExtendedType diff --git a/pkg/smartcontract/rpcbinding/binding.go b/pkg/smartcontract/rpcbinding/binding.go index 074b41c49..a3eab9576 100644 --- a/pkg/smartcontract/rpcbinding/binding.go +++ b/pkg/smartcontract/rpcbinding/binding.go @@ -693,8 +693,9 @@ func scTemplateToRPC(cfg binding.Config, ctr ContractTmpl, imports map[string]st ) if extType, ok = cfg.Types[fullPName]; !ok { extType = binding.ExtendedType{ - Base: abiEvent.Parameters[i].Type, // TODO: properly handle imports for this case (see utf8 example) + Base: abiEvent.Parameters[i].Type, } + addETImports(extType, ctr.NamedTypes, imports) } eTmp.Parameters = append(eTmp.Parameters, EventParamTmpl{ ParamTmpl: binding.ParamTmpl{