*: add data
to NEP11 Transfer
This commit is contained in:
parent
bb039ef035
commit
d0c64347ab
18 changed files with 163 additions and 100 deletions
|
@ -108,13 +108,13 @@ func TestOnPayableChecks(t *testing.T) {
|
|||
t.Run("NEP-11, good", func(t *testing.T) {
|
||||
src := `package payable
|
||||
import "github.com/nspcc-dev/neo-go/pkg/interop"
|
||||
func OnNEP11Payment(from interop.Hash160, amount int, tokenID []byte) {}`
|
||||
func OnNEP11Payment(from interop.Hash160, amount int, tokenID []byte, data interface{}) {}`
|
||||
require.NoError(t, compileAndCheck(t, src))
|
||||
})
|
||||
t.Run("NEP-11, bad", func(t *testing.T) {
|
||||
src := `package payable
|
||||
import "github.com/nspcc-dev/neo-go/pkg/interop"
|
||||
func OnNEP11Payment(from interop.Hash160, amount int, oldParam string, tokenID []byte) {}`
|
||||
func OnNEP11Payment(from interop.Hash160, amount int, oldParam string, tokenID []byte, data interface{}) {}`
|
||||
require.Error(t, compileAndCheck(t, src))
|
||||
})
|
||||
t.Run("NEP-17, good", func(t *testing.T) {
|
||||
|
|
|
@ -169,7 +169,7 @@ func TestNativeHelpersCompile(t *testing.T) {
|
|||
{"properties", []string{`"neo.com"`}},
|
||||
{"tokens", nil},
|
||||
{"tokensOf", []string{u160}},
|
||||
{"transfer", []string{u160, `"neo.com"`}},
|
||||
{"transfer", []string{u160, `"neo.com"`, "nil"}},
|
||||
|
||||
// name service
|
||||
{"addRoot", []string{`"com"`}},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue