From 6b7a57a66fc3ab635709ac117d32f8118e2762b0 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 18 Mar 2020 18:20:31 +0300 Subject: [PATCH] smartcontract: add Any type for parameter It is used as a wildcard for default return type of a contract and for a Null stack item. --- pkg/smartcontract/param_type.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/smartcontract/param_type.go b/pkg/smartcontract/param_type.go index 7623aa5d1..3c2ab38c1 100644 --- a/pkg/smartcontract/param_type.go +++ b/pkg/smartcontract/param_type.go @@ -30,6 +30,7 @@ const ( ArrayType ParamType = 0x10 MapType ParamType = 0x12 InteropInterfaceType ParamType = 0xf0 + AnyType ParamType = 0xfe VoidType ParamType = 0xff ) @@ -60,6 +61,8 @@ func (pt ParamType) String() string { return "InteropInterface" case VoidType: return "Void" + case AnyType: + return "Any" default: return "" } @@ -154,6 +157,8 @@ func ParseParamType(typ string) (ParamType, error) { return InteropInterfaceType, nil case "void": return VoidType, nil + case "any": + return AnyType, nil default: return UnknownType, errors.Errorf("Unknown contract parameter type: %s", typ) }