Documentation ¶
Index ¶
- Variables
- func CanTransfer(db state.EVMStateDB, sender, recipient common.Address, amount uint64) bool
- func GetHashFn(api client.QueueProtocolAPI) func(blockHeight uint64) common.Hash
- func GetName() string
- func Init(name string, sub []byte)
- 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) (*types.LocalDBSet, 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) (msg *common.Message, err error)
- func (evm *EVMExecutor) GetVMConfig() *runtime.Config
- func (evm *EVMExecutor) IsFriend(myexec, writekey []byte, othertx *types.Transaction) bool
- func (evm *EVMExecutor) NewEVMContext(msg *common.Message) runtime.Context
- func (evm *EVMExecutor) Query_CheckAddrExists(in *evmtypes.CheckEVMAddrReq) (types.Message, error)
- func (evm *EVMExecutor) Query_EstimateGas(in *evmtypes.EstimateEVMGasReq) (types.Message, error)
- func (evm *EVMExecutor) Query_EvmDebug(in *evmtypes.EvmDebugReq) (types.Message, error)
- func (evm *EVMExecutor) Query_Query(in *evmtypes.EvmQueryReq) (types.Message, error)
- func (evm *EVMExecutor) Query_QueryABI(in *evmtypes.EvmQueryAbiReq) (types.Message, error)
Constants ¶
This section is empty.
Variables ¶
var ( // EvmAddress 本合约地址 EvmAddress = address.ExecAddress(types.ExecName(evmtypes.ExecutorName)) )
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) (*types.LocalDBSet, 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) (msg *common.Message, err error)
GetMessage 目前的交易中,如果是coins交易,金额是放在payload的,但是合约不行,需要修改Transaction结构
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 ¶
func (evm *EVMExecutor) NewEVMContext(msg *common.Message) runtime.Context
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(in *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 此方法用来估算合约消耗的Gas,不能修改原有执行器的状态数据
func (*EVMExecutor) Query_Query ¶
func (evm *EVMExecutor) Query_Query(in *evmtypes.EvmQueryReq) (types.Message, error)
Query_Query 此方法用来调用合约的只读接口,不修改原有执行器的状态数据
func (*EVMExecutor) Query_QueryABI ¶
func (evm *EVMExecutor) Query_QueryABI(in *evmtypes.EvmQueryAbiReq) (types.Message, error)
Query_QueryABI 此方法用来查询合约绑定的ABI数据,不修改原有执行器的状态数据