forked from TrueCloudLab/neoneo-go
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.
This commit is contained in:
parent
f64aa201c7
commit
6b7a57a66f
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue