From 1cb25d31906124148a3e7be982c7ed1265b564d3 Mon Sep 17 00:00:00 2001 From: Evgeniy Stratonikov Date: Fri, 5 Mar 2021 15:44:22 +0300 Subject: [PATCH] native: use proper types in manifest --- pkg/core/native/native_neo.go | 6 +++--- pkg/core/native/nonfungible.go | 4 ++-- pkg/smartcontract/manifest/standard/nep11.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/core/native/native_neo.go b/pkg/core/native/native_neo.go index c4c9c51cf..248a502f8 100644 --- a/pkg/core/native/native_neo.go +++ b/pkg/core/native/native_neo.go @@ -123,18 +123,18 @@ func newNEO() *NEO { n.AddMethod(md, desc) desc = newDescriptor("registerCandidate", smartcontract.BoolType, - manifest.NewParameter("pubkey", smartcontract.ByteArrayType)) + manifest.NewParameter("pubkey", smartcontract.PublicKeyType)) md = newMethodAndPrice(n.registerCandidate, 0, callflag.States) n.AddMethod(md, desc) desc = newDescriptor("unregisterCandidate", smartcontract.BoolType, - manifest.NewParameter("pubkey", smartcontract.ByteArrayType)) + manifest.NewParameter("pubkey", smartcontract.PublicKeyType)) md = newMethodAndPrice(n.unregisterCandidate, 1<<16, callflag.States) n.AddMethod(md, desc) desc = newDescriptor("vote", smartcontract.BoolType, manifest.NewParameter("account", smartcontract.Hash160Type), - manifest.NewParameter("voteTo", smartcontract.ByteArrayType)) + manifest.NewParameter("voteTo", smartcontract.PublicKeyType)) md = newMethodAndPrice(n.vote, 1<<16, callflag.States) n.AddMethod(md, desc) diff --git a/pkg/core/native/nonfungible.go b/pkg/core/native/nonfungible.go index 49846e313..efb981668 100644 --- a/pkg/core/native/nonfungible.go +++ b/pkg/core/native/nonfungible.go @@ -95,11 +95,11 @@ func newNonFungible(name string, id int32, symbol string, decimals byte) *nonfun md = newMethodAndPrice(n.Properties, 1<<15, callflag.ReadStates) n.AddMethod(md, desc) - desc = newDescriptor("tokens", smartcontract.AnyType) + desc = newDescriptor("tokens", smartcontract.InteropInterfaceType) md = newMethodAndPrice(n.tokens, 1<<15, callflag.ReadStates) n.AddMethod(md, desc) - desc = newDescriptor("tokensOf", smartcontract.AnyType, + desc = newDescriptor("tokensOf", smartcontract.InteropInterfaceType, manifest.NewParameter("owner", smartcontract.Hash160Type)) md = newMethodAndPrice(n.tokensOf, 1<<15, callflag.ReadStates) n.AddMethod(md, desc) diff --git a/pkg/smartcontract/manifest/standard/nep11.go b/pkg/smartcontract/manifest/standard/nep11.go index 7d090a196..2761e60ca 100644 --- a/pkg/smartcontract/manifest/standard/nep11.go +++ b/pkg/smartcontract/manifest/standard/nep11.go @@ -19,12 +19,12 @@ var nep11Base = &Standard{ Safe: true, }, { - Name: "tokensOf", - ReturnType: smartcontract.AnyType, // Iterator + Name: "tokensOf", Parameters: []manifest.Parameter{ {Name: "owner", Type: smartcontract.Hash160Type}, }, - Safe: true, + ReturnType: smartcontract.InteropInterfaceType, + Safe: true, }, { Name: "transfer", @@ -59,7 +59,7 @@ var nep11Base = &Standard{ }, { Name: "tokens", - ReturnType: smartcontract.AnyType, + ReturnType: smartcontract.InteropInterfaceType, Safe: true, }, },