Documentation ¶
Index ¶
- Constants
- Variables
- func FieldsToJSON(fields []Field, version module.JSONVersion) (interface{}, error)
- func ParseHexIntParam(bs []byte) (*common.HexInt, error)
- type DataType
- func (t DataType) ConvertBytesToJSO(bs []byte) (interface{}, error)
- func (t DataType) ConvertBytesToTypedObj(bs []byte) (*codec.TypedObj, error)
- func (t DataType) ConvertJSONToTypedObj(bs []byte, fields []Field, nullable bool) (*codec.TypedObj, error)
- func (t DataType) Elem() DataType
- func (t DataType) IsList() bool
- func (t DataType) ListDepth() int
- func (t DataType) String() string
- func (t DataType) Tag() TypeTag
- func (t DataType) UsableForEvent() bool
- func (t DataType) ValidateEvent(bs []byte) error
- func (t DataType) ValidateInput(obj *codec.TypedObj, fields []Field, nullable bool) error
- func (t DataType) ValidateOutput(obj *codec.TypedObj) error
- type Field
- type Info
- func (info *Info) Bytes() ([]byte, error)
- func (info *Info) CheckEventData(indexed [][]byte, data [][]byte) error
- func (info *Info) ConvertParamsToTypedObj(method string, params []byte) (*codec.TypedObj, error)
- func (info *Info) EnsureParamsSequential(method string, params *codec.TypedObj) (*codec.TypedObj, error)
- func (info *Info) Equal(info2 *Info) bool
- func (info *Info) GetMethod(name string) *Method
- func (info *Info) MethodIterator() MethodIterator
- func (info *Info) RLPDecodeSelf(d codec.Decoder) error
- func (info *Info) RLPEncodeSelf(e codec.Encoder) error
- func (info *Info) SetBytes(bs []byte) error
- func (info *Info) String() string
- func (info *Info) ToJSON(v module.JSONVersion) (interface{}, error)
- type Method
- func (a *Method) CheckEventData(indexed [][]byte, data [][]byte) error
- func (a *Method) ConvertParamsToTypedObj(bs []byte, allowExtra bool) (*codec.TypedObj, error)
- func (a *Method) EnsureParamsSequential(paramObj *codec.TypedObj) (*codec.TypedObj, error)
- func (a *Method) EnsureResult(result *codec.TypedObj) error
- func (a *Method) IsCallable() bool
- func (a *Method) IsEvent() bool
- func (a *Method) IsExternal() bool
- func (a *Method) IsFallback() bool
- func (a *Method) IsIsolated() bool
- func (a *Method) IsPayable() bool
- func (a *Method) IsReadOnly() bool
- func (a *Method) Signature() string
- func (a *Method) String() string
- func (a *Method) ToJSON(version module.JSONVersion) (interface{}, error)
- type MethodIterator
- type MethodType
- type Parameter
- type TypeTag
Constants ¶
View Source
const ( NoSignatureError = errorBase + iota IllegalEventError )
View Source
const ( FlagReadOnly = 1 << iota FlagExternal FlagPayable FlagIsolated )
View Source
const (
FallbackMethodName = ""
)
Variables ¶
View Source
var ( ErrNoSignature = errors.NewBase(NoSignatureError, "NoSignatureError") ErrIllegalEvent = errors.NewBase(IllegalEventError, "IllegalEventError") )
Functions ¶
func FieldsToJSON ¶ added in v0.9.4
func FieldsToJSON(fields []Field, version module.JSONVersion) (interface{}, error)
func ParseHexIntParam ¶ added in v0.9.6
ParseHexIntParam reproduce same decoding logics of parameter parsing of ICON.
def str_to_int(value: str) -> int:
if isinstance(value, int): return value base = 16 if is_hex(value) else 10 return int(value, base)
Types ¶
type DataType ¶
type DataType int
DataType composed of following bits. ListDepth(4bits) + TypeTag(4bits)
func DataTypeOf ¶
DataTypeOf returns type for the specified name.
func ListTypeOf ¶
func (DataType) ConvertBytesToJSO ¶
DecodeForJSON convert default bytes and event bytes into JSON value type.
func (DataType) ConvertBytesToTypedObj ¶
Decode convert default bytes into native type
func (DataType) ConvertJSONToTypedObj ¶
func (t DataType) ConvertJSONToTypedObj(bs []byte, fields []Field, nullable bool) (*codec.TypedObj, error)
DecodeJSO decode json object comes from JSON.
func (DataType) UsableForEvent ¶ added in v1.3.0
func (DataType) ValidateEvent ¶
ValidateBytes validate event bytes.
func (DataType) ValidateInput ¶
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
func (*Info) CheckEventData ¶
func (*Info) ConvertParamsToTypedObj ¶
func (*Info) EnsureParamsSequential ¶
func (*Info) MethodIterator ¶ added in v0.9.6
func (info *Info) MethodIterator() MethodIterator
type Method ¶
type Method struct { Type MethodType Name string Flags int Indexed int Inputs []Parameter Outputs []DataType }
func (*Method) CheckEventData ¶
func (*Method) ConvertParamsToTypedObj ¶
func (*Method) EnsureParamsSequential ¶
func (*Method) IsCallable ¶
func (*Method) IsExternal ¶
func (*Method) IsFallback ¶
func (*Method) IsIsolated ¶
func (*Method) IsReadOnly ¶
type MethodIterator ¶ added in v0.9.6
type MethodType ¶
type MethodType int
const ( Function MethodType = iota Fallback Event )
func (MethodType) String ¶
func (t MethodType) String() string
Click to show internal directories.
Click to hide internal directories.