diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index 2bfa66d0d..8ee039189 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -13,6 +13,7 @@ import ( "path/filepath" "strings" + "github.com/nspcc-dev/neo-go/pkg/smartcontract" "github.com/nspcc-dev/neo-go/pkg/smartcontract/binding" "github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest" "github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest/standard" @@ -363,6 +364,9 @@ func CreateManifest(di *DebugInfo, o *Options) (*manifest.Manifest, error) { name, len(ev.Parameters), len(argsList[i])) } for j := range ev.Parameters { + if ev.Parameters[j].Type == smartcontract.AnyType { + continue + } expected := ev.Parameters[j].Type.String() if argsList[i][j] != expected { return nil, fmt.Errorf("event '%s' should have '%s' as type of %d parameter, "+ diff --git a/pkg/compiler/compiler_test.go b/pkg/compiler/compiler_test.go index 0e0756128..7fc6db6a6 100644 --- a/pkg/compiler/compiler_test.go +++ b/pkg/compiler/compiler_test.go @@ -174,6 +174,16 @@ func TestEventWarnings(t *testing.T) { }) require.Error(t, err) }) + t.Run("any parameter type", func(t *testing.T) { + _, err = compiler.CreateManifest(di, &compiler.Options{ + ContractEvents: []manifest.Event{{ + Name: "Event", + Parameters: []manifest.Parameter{manifest.NewParameter("number", smartcontract.AnyType)}, + }}, + Name: "payable", + }) + require.NoError(t, err) + }) t.Run("good", func(t *testing.T) { _, err = compiler.CreateManifest(di, &compiler.Options{ ContractEvents: []manifest.Event{{