Documentation ¶
Index ¶
- Constants
- func AbiParse(abiFilePath, str string) []byte
- func ChainParamConvert(param, paramName string) interface{}
- func CombineFuncParams(args ...string) []string
- func CombineRule(addr, api string) string
- func ConvertSelect(param, paramName string) (interface{}, error)
- func IsNameOrAddress(str string) int32
- func ParamParse(param, paramName string) interface{}
- func ParamValidWrap(param, paramName string) bool
- type Cns
- type Convert
Constants ¶
const ( CnsIsName int32 = iota CnsIsAddress CnsIsUndefined )
Variables ¶
This section is empty.
Functions ¶
func AbiParse ¶
===============================Abi Parsing======================================== AbiParse gets the abi bytes by the input parameters provided The abi file can be obtained through following ways: 1. user provide the abi file path 2. abiBytes of precompiled contracts (see precompiled/bindata.go) (currently, the following features are not enabled) a. get the abi files from default abi file locations b. get the abi bytes on chain (wasm contract only).
func ChainParamConvert ¶
func ChainParamConvert(param, paramName string) interface{}
ChainParamConvert convert the string to chain defined type
func CombineFuncParams ¶
CombineFuncParams combines the function parameters
func ConvertSelect ¶
func IsNameOrAddress ¶
IsNameOrAddress Judge whether the input string is an address or a name
func ParamParse ¶
func ParamParse(param, paramName string) interface{}
ParamParse convert the user inputs to the value needed
func ParamValidWrap ¶
Types ¶
type Cns ¶
type Cns struct { /// To common.Address Name string // the cns name of contract TxType uint64 // the transaction type of the contract execution (EXECUTE_CONTRACT or CNS_TX_TYPE) }
type Convert ¶
type Convert struct {
// contains filtered or unexported fields
}
convert, convert user input from key to value
func NewConvert ¶
Some of the contract function inputs are numbers, these numbers are hard for users to remember the meanings behind them, Thus, to simplify the user input, we convert the meaningful strings to number automatically For example, if user input: "valid", the converter will convert the string to 1