Skip to content

Commit

Permalink
Merge pull request #1820 from nspcc-dev/fix/nativetypes
Browse files Browse the repository at this point in the history
native: use proper types in manifest
  • Loading branch information
roman-khimov authored Mar 11, 2021
2 parents 72e2d89 + 1cb25d3 commit 096f48c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pkg/core/native/native_neo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions pkg/core/native/nonfungible.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions pkg/smartcontract/manifest/standard/nep11.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -59,7 +59,7 @@ var nep11Base = &Standard{
},
{
Name: "tokens",
ReturnType: smartcontract.AnyType,
ReturnType: smartcontract.InteropInterfaceType,
Safe: true,
},
},
Expand Down

0 comments on commit 096f48c

Please sign in to comment.