Versions in this module Expand all Collapse all v3 v3.0.1 Dec 26, 2023 Changes in this version + func GetSenderPublicKey(txSimContext protocol.TxSimContext) ([]byte, error) + func PublicKeyToAddress(publicKey []byte, chainCfg *configPb.ChainConfig) (string, error) + func VerifyAndToLowerAddress(context protocol.TxSimContext, address string) (string, bool) + func VerifyAndToLowerAddress2(blockVersion uint32, addrType configPb.AddrType, address string) (string, bool) + func WrapResultUint64(i uint64, err error) *common.ContractResult + type TruncateConfig struct + func NewTruncateConfig(truncateValueLen int, truncateModel string) *TruncateConfig + func (t *TruncateConfig) TruncateBlock(b *commonPb.Block) + func (t *TruncateConfig) TruncateBlockWithRWSet(b *commonPb.BlockInfo) + func (t *TruncateConfig) TruncatePayload(payload *commonPb.Payload) + func (t *TruncateConfig) TruncateRWSet(rwset *commonPb.TxRWSet) + func (t *TruncateConfig) TruncateTx(tx *commonPb.Transaction) v3.0.0 Dec 23, 2022 Changes in this version + const DefaultGas + var ErrContractIdIsNil = errors.New("the contractId is empty") + var ErrContractName = errors.New("the contractName is error") + var ErrContractNotFound = errors.New("the contractName is not exist") + var ErrMethodNotFound = errors.New("the method does not found") + var ErrOutOfRange = errors.New("out of range") + var ErrParams = errors.New("params is error") + var ErrParamsEmpty = errors.New("the params is empty") + var ErrSequence = errors.New("sequence is error") + var ErrTxTypeNotSupport = errors.New("the txType does not support") + var ErrUnmarshalFailed = errors.New("unmarshal is error") + func BytesPrefix(prefix []byte) ([]byte, []byte) + func FormatBytesResult(result []byte, parameters map[string][]byte, ...) ([]byte, error) + func FormatObjectResult(result interface{}, parameters map[string][]byte, ...) ([]byte, error) + func GetChainConfig(txSimContext protocol.TxSimContext) (*configPb.ChainConfig, error) + func GetChainConfigNoRecord(txSimContext protocol.TxSimContext) (*configPb.ChainConfig, error) + func GetGas(contractName, method string, defaultGas uint64) uint64 + func ResultBytesAndError(returnResult []byte, event []*common.ContractEvent, err error) *common.ContractResult + func ResultError(err error) *common.ContractResult + func ResultErrorWithGasUsed(err error, gas uint64) *common.ContractResult + func ResultJson(obj interface{}) (*common.ContractResult, error) + func ResultSuccess(result []byte, gas uint64) *common.ContractResult + func WrapEventResult(...) ... + func WrapResultFunc(...) ... + type BaseContract struct + func (g *BaseContract) GetMethod(methodName string, blockVersion uint32) ContractFunc + func (g *BaseContract) InitMethod(ms map[string]ContractFunc) + func (g *BaseContract) RegisterMethod(methodName string, f ContractFunc, startVersion uint32, endVersion uint32) + type Contract interface + GetMethod func(methodName string, blockVersion uint32) ContractFunc + type ContractFunc func(context protocol.TxSimContext, params map[string][]byte) *common.ContractResult Other modules containing this package chainmaker.org/chainmaker/vm-native/v2