Documentation ¶
Index ¶
- func CanTransfer(db state.EVMStateDB, sender common.Address, amount uint64) bool
- func GetHashFn(api client.QueueProtocolAPI) func(blockHeight uint64) common.Hash
- func GetName() string
- func Init(name string, cfg *types.Chain33Config, sub []byte)
- func InitExecType()
- func Transfer(db state.EVMStateDB, sender, recipient common.Address, amount uint64) bool
- type EVMExecutor
- func (evm *EVMExecutor) Allow(tx *types.Transaction, index int) error
- func (evm *EVMExecutor) CheckInit()
- func (evm *EVMExecutor) CheckReceiptExecOk() bool
- func (evm *EVMExecutor) CheckTx(tx *types.Transaction, index int) error
- func (evm *EVMExecutor) Exec(tx *types.Transaction, index int) (*types.Receipt, error)
- func (evm *EVMExecutor) ExecDelLocal(tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)
- func (evm *EVMExecutor) ExecLocal(tx *types.Transaction, receipt *types.ReceiptData, index int) (set *types.LocalDBSet, err error)
- func (evm *EVMExecutor) ExecutorOrder() int64
- func (evm *EVMExecutor) GetActionName(tx *types.Transaction) string
- func (evm *EVMExecutor) GetDriverName() string
- func (evm *EVMExecutor) GetFuncMap() map[string]reflect.Method
- func (evm *EVMExecutor) GetMStateDB() *state.MemoryStateDB
- func (evm *EVMExecutor) GetMessage(tx *types.Transaction, index int, fromPtr *common.Address) (msg *common.Message, err error)
- func (evm *EVMExecutor) GetTxFee(tx *types.Transaction, index int) int64
- func (evm *EVMExecutor) GetVMConfig() *runtime.Config
- func (evm *EVMExecutor) IsFriend(myexec, writekey []byte, othertx *types.Transaction) bool
- func (evm *EVMExecutor) NewEVMContext(msg *common.Message, txHash []byte) runtime.Context
- func (evm *EVMExecutor) Query_CheckAddrExists(in *evmtypes.CheckEVMAddrReq) (types.Message, error)
- func (evm *EVMExecutor) Query_EstimateGas(req *evmtypes.EstimateEVMGasReq) (types.Message, error)
- func (evm *EVMExecutor) Query_EvmDebug(in *evmtypes.EvmDebugReq) (types.Message, error)
- func (evm *EVMExecutor) Query_GetCode(in *evmtypes.CheckEVMAddrReq) (types.Message, error)
- func (evm *EVMExecutor) Query_GetNonce(in *evmtypes.EvmGetNonceReq) (types.Message, error)
- func (evm *EVMExecutor) Query_GetPackData(in *evmtypes.EvmGetPackDataReq) (types.Message, error)
- func (evm *EVMExecutor) Query_GetUnpackData(in *evmtypes.EvmGetUnpackDataReq) (types.Message, error)
- func (evm *EVMExecutor) Query_Query(in *evmtypes.EvmQueryReq) (types.Message, error)
- func (evm *EVMExecutor) Upgrade() (*types.LocalDBSet, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanTransfer ¶
CanTransfer 检查合约调用账户是否有充足的金额进行转账交易操作
Types ¶
type EVMExecutor ¶
type EVMExecutor struct { drivers.DriverBase // contains filtered or unexported fields }
EVMExecutor EVM执行器结构
func (*EVMExecutor) Allow ¶
func (evm *EVMExecutor) Allow(tx *types.Transaction, index int) error
Allow 允许哪些交易在本命执行器执行
func (*EVMExecutor) CheckReceiptExecOk ¶
func (evm *EVMExecutor) CheckReceiptExecOk() bool
CheckReceiptExecOk return true to check if receipt ty is ok
func (*EVMExecutor) CheckTx ¶
func (evm *EVMExecutor) CheckTx(tx *types.Transaction, index int) error
CheckTx 校验交易
func (*EVMExecutor) Exec ¶
func (evm *EVMExecutor) Exec(tx *types.Transaction, index int) (*types.Receipt, error)
Exec 本合约执行逻辑
func (*EVMExecutor) ExecDelLocal ¶
func (evm *EVMExecutor) ExecDelLocal(tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal 处理区块回滚
func (*EVMExecutor) ExecLocal ¶
func (evm *EVMExecutor) ExecLocal(tx *types.Transaction, receipt *types.ReceiptData, index int) (set *types.LocalDBSet, err error)
ExecLocal 处理本地区块新增逻辑
func (*EVMExecutor) ExecutorOrder ¶
func (evm *EVMExecutor) ExecutorOrder() int64
ExecutorOrder 设置localdb的EnableRead
func (*EVMExecutor) GetActionName ¶
func (evm *EVMExecutor) GetActionName(tx *types.Transaction) string
GetActionName 获取运行状态名
func (*EVMExecutor) GetDriverName ¶
func (evm *EVMExecutor) GetDriverName() string
GetDriverName 获取本合约驱动名称
func (*EVMExecutor) GetFuncMap ¶
func (evm *EVMExecutor) GetFuncMap() map[string]reflect.Method
GetFuncMap 获取方法列表
func (*EVMExecutor) GetMStateDB ¶
func (evm *EVMExecutor) GetMStateDB() *state.MemoryStateDB
GetMStateDB 获取内部状态数据库
func (*EVMExecutor) GetMessage ¶
func (evm *EVMExecutor) GetMessage(tx *types.Transaction, index int, fromPtr *common.Address) (msg *common.Message, err error)
GetMessage 目前的交易中,如果是coins交易,金额是放在payload的,但是合约不行,需要修改Transaction结构
func (*EVMExecutor) GetTxFee ¶ added in v1.65.2
func (evm *EVMExecutor) GetTxFee(tx *types.Transaction, index int) int64
GetTxFee 获取交易手续费,支持交易组
func (*EVMExecutor) GetVMConfig ¶
func (evm *EVMExecutor) GetVMConfig() *runtime.Config
GetVMConfig 获取VM配置
func (*EVMExecutor) IsFriend ¶
func (evm *EVMExecutor) IsFriend(myexec, writekey []byte, othertx *types.Transaction) bool
IsFriend 是否允许对应的KEY
func (*EVMExecutor) NewEVMContext ¶
NewEVMContext 构造一个新的EVM上下文对象
func (*EVMExecutor) Query_CheckAddrExists ¶
func (evm *EVMExecutor) Query_CheckAddrExists(in *evmtypes.CheckEVMAddrReq) (types.Message, error)
Query_CheckAddrExists 检查合约地址是否存在,此操作不会改变任何状态,所以可以直接从statedb查询
func (*EVMExecutor) Query_EstimateGas ¶
func (evm *EVMExecutor) Query_EstimateGas(req *evmtypes.EstimateEVMGasReq) (types.Message, error)
Query_EstimateGas 此方法用来估算合约消耗的Gas,不能修改原有执行器的状态数据
func (*EVMExecutor) Query_EvmDebug ¶
func (evm *EVMExecutor) Query_EvmDebug(in *evmtypes.EvmDebugReq) (types.Message, error)
Query_EvmDebug 此方法用来控制evm调试打印开关
func (*EVMExecutor) Query_GetCode ¶ added in v1.67.4
func (evm *EVMExecutor) Query_GetCode(in *evmtypes.CheckEVMAddrReq) (types.Message, error)
Query_GetCode 获取合约地址下的code
func (*EVMExecutor) Query_GetNonce ¶ added in v1.65.3
func (evm *EVMExecutor) Query_GetNonce(in *evmtypes.EvmGetNonceReq) (types.Message, error)
Query_GetNonce 获取普通账户的Nonce
func (*EVMExecutor) Query_GetPackData ¶ added in v1.65.3
func (evm *EVMExecutor) Query_GetPackData(in *evmtypes.EvmGetPackDataReq) (types.Message, error)
Query_GetPackData ...
func (*EVMExecutor) Query_GetUnpackData ¶ added in v1.65.3
func (evm *EVMExecutor) Query_GetUnpackData(in *evmtypes.EvmGetUnpackDataReq) (types.Message, error)
Query_GetUnpackData ...
func (*EVMExecutor) Query_Query ¶
func (evm *EVMExecutor) Query_Query(in *evmtypes.EvmQueryReq) (types.Message, error)
Query_Query 此方法用来调用合约的只读接口,不修改原有执行器的状态数据
func (*EVMExecutor) Upgrade ¶ added in v1.68.4
func (evm *EVMExecutor) Upgrade() (*types.LocalDBSet, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
vm
|
|
common/math
Package math provides integer math utilities.
|
Package math provides integer math utilities. |