Merge pull request #1820 from nspcc-dev/fix/nativetypes

native: use proper types in manifest
This commit is contained in:
Roman Khimov 2021-03-11 17:02:34 +03:00 committed by GitHub
commit 096f48caf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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,
},
},