Documentation ¶
Index ¶
- Variables
- func CanTransfer(db vm.StateDB, addr utils.Address, amount *big.Int) bool
- func ExecStateTransition(txfrom *utils.Address, evm *vm.EVM, tx *types.Transaction, gp *utils.GasPool) ([]byte, uint64, bool, error)
- func NewEVMContext(tx *types.Transaction, bheader *types.BlockHeader, ledger *ledger.Ledger, ...) vm.Context
- func Transfer(db vm.StateDB, sender, recipient utils.Address, amount *big.Int)
- type Executor
- func (e *Executor) ExecActions(statedb *state.StateDB, actions []*types.Action)
- func (e *Executor) ExecBlock(block *types.Block, statedb *state.StateDB, cfg vm.Config) (types.Receipts, []*types.Log, uint64, error)
- func (e *Executor) ExecTransaction(author, txFrom *utils.Address, dposContext *types.DposContext, ...) ([]byte, *types.Receipt, uint64, error)
- func (e *Executor) SetTxPool(tp ITxPool)
- type ITxPool
- type StateTransition
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNonceTooLow is returned if the nonce of a transaction is lower than the // one present in the local chain. ErrNonceTooLow = errors.New("nonce too low") // ErrNonceTooHigh is returned if the nonce of a transaction is higher than the // next one expected based on the local chain. ErrNonceTooHigh = errors.New("nonce too high") )
Functions ¶
func CanTransfer ¶
CanTransfer checks wether there are enough funds in the address' account to make a transfer. This does not take the necessary gas in to account to make the transfer valid.
func ExecStateTransition ¶
func ExecStateTransition(txfrom *utils.Address, evm *vm.EVM, tx *types.Transaction, gp *utils.GasPool) ([]byte, uint64, bool, error)
ExecStateTransition computes the new state by applying the given message against the old state within the environment.
func NewEVMContext ¶
func NewEVMContext(tx *types.Transaction, bheader *types.BlockHeader, ledger *ledger.Ledger, engine consensus.Engine, author, txFrom *utils.Address) vm.Context
NewEVMContext creates a new context for use in the EVM.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor is a transactions executor
func NewExecutor ¶
func NewExecutor(config *params.ChainConfig, l *ledger.Ledger, chain consensus.IChainReader, engine consensus.Engine) *Executor
NewExecutor initialises a new Executor.
func (*Executor) ExecActions ¶
ExecActions execute actions
func (*Executor) ExecBlock ¶
func (e *Executor) ExecBlock(block *types.Block, statedb *state.StateDB, cfg vm.Config) (types.Receipts, []*types.Log, uint64, error)
ExecBlock execute block
func (*Executor) ExecTransaction ¶
func (e *Executor) ExecTransaction(author, txFrom *utils.Address, dposContext *types.DposContext, gp *utils.GasPool, statedb *state.StateDB, header *types.BlockHeader, tx *types.Transaction, usedGas *uint64, cfg vm.Config) ([]byte, *types.Receipt, uint64, error)
ExecTransaction attempts to execute a transaction to the given state database and uses the input parameters for its environment.
type StateTransition ¶
type StateTransition struct {
// contains filtered or unexported fields
}
func NewStateTransition ¶
func NewStateTransition(txFrom *utils.Address, evm *vm.EVM, tx *types.Transaction, gp *utils.GasPool) *StateTransition
NewStateTransition initialises and returns a new state transition object.
func NewStateTransitionForApi ¶
func NewStateTransitionForApi(evm *vm.EVM, from utils.Address, tx *types.Transaction, gp *utils.GasPool) *StateTransition
func (*StateTransition) TransitionDb ¶
func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bool, err error)
TransitionDb will transition the state by applying the current message and returning the result including the the used gas.