Versions in this module Expand all Collapse all v0 v0.0.2 Dec 21, 2022 v0.0.1 Dec 21, 2022 Changes in this version + const TxGas + const TxGasContractCreation + var ErrAllGasUsed = errors.New("all gas used") + var ErrBlockLimitReached = errors.New("gas limit reached in the pool") + var ErrExecutionStop = errors.New("execution stop") + var ErrIntrinsicGasOverflow = errors.New("overflow in intrinsic gas calculation") + var ErrNonceIncorrect = errors.New("incorrect nonce") + var ErrNotEnoughFunds = errors.New("not enough funds for transfer with given value") + var ErrNotEnoughFundsForGas = errors.New("not enough funds to cover gas costs") + var ErrNotEnoughIntrinsicGas = errors.New("not enough gas supplied for intrinsic gas costs") + func TestState(t *testing.T, buildPreState buildPreState) + func TransactionGasCost(msg *types.Transaction, isHomestead, isIstanbul bool) (uint64, error) + type Account struct + Balance *big.Int + CodeHash []byte + Nonce uint64 + Root types.Hash + Trie accountTrie + func (a *Account) Copy() *Account + func (a *Account) MarshalWith(ar *fastrlp.Arena) *fastrlp.Value + func (a *Account) String() string + func (a *Account) UnmarshalRlp(b []byte) error + type AllGasUsedError struct + func NewAllGasUsedError(err error) *AllGasUsedError + type BlockResult struct + Receipts []*types.Receipt + Root types.Hash + TotalGas uint64 + type Executor struct + GetHash GetHashByNumberHelper + PostHook func(txn *Transition) + func NewExecutor(config *chain.Params, s State, logger hclog.Logger) *Executor + func (e *Executor) BeginTxn(parentRoot types.Hash, header *types.Header, coinbaseReceiver types.Address) (*Transition, error) + func (e *Executor) GetForksInTime(blockNumber uint64) chain.ForksInTime + func (e *Executor) IsStopped() bool + func (e *Executor) ProcessBlock(parentRoot types.Hash, block *types.Block, blockCreator types.Address) (*Transition, error) + func (e *Executor) ProcessTransactions(txn *Transition, gasLimit uint64, transactions []*types.Transaction) (*Transition, error) + func (e *Executor) SetRuntime(r runtime.Runtime) + func (e *Executor) State() State + func (e *Executor) StateAt(root types.Hash) (Snapshot, error) + func (e *Executor) Stop() + func (e *Executor) WriteGenesis(alloc map[types.Address]*chain.GenesisAccount) types.Hash + type GasLimitReachedTransitionApplicationError struct + func NewGasLimitReachedTransitionApplicationError(err error) *GasLimitReachedTransitionApplicationError + type GetHashByNumber = func(i uint64) types.Hash + type GetHashByNumberHelper = func(*types.Header) GetHashByNumber + type NonceTooHighError struct + CorrectNonce uint64 + func NewNonceTooHighError(err error, correctNonce uint64) *NonceTooHighError + type NonceTooLowError struct + CorrectNonce uint64 + func NewNonceTooLowError(err error, correctNonce uint64) *NonceTooLowError + type Object struct + Address types.Address + Balance *big.Int + Code []byte + CodeHash types.Hash + Deleted bool + DirtyCode bool + Nonce uint64 + Root types.Hash + Storage []*StorageObject + type PreState struct + Balance uint64 + Nonce uint64 + State map[types.Hash]types.Hash + type PreStates map[types.Address]*PreState + type Snapshot interface + Commit func(objs []*Object) (Snapshot, []byte) + Get func(k []byte) ([]byte, bool) + type State interface + GetCode func(hash types.Hash) ([]byte, bool) + NewSnapshot func() Snapshot + NewSnapshotAt func(types.Hash) (Snapshot, error) + type StateObject struct + Account *Account + Code []byte + Deleted bool + DirtyCode bool + Suicide bool + Txn *iradix.Txn + func (s *StateObject) Copy() *StateObject + func (s *StateObject) Empty() bool + func (s *StateObject) GetCommitedState(key types.Hash) types.Hash + type StorageObject struct + Deleted bool + Key []byte + Val []byte + type Transition struct + func (t *Transition) AccountExists(addr types.Address) bool + func (t *Transition) Apply(msg *types.Transaction) (*runtime.ExecutionResult, error) + func (t *Transition) Call2(caller types.Address, to types.Address, input []byte, value *big.Int, ...) *runtime.ExecutionResult + func (t *Transition) Callx(c *runtime.Contract, h runtime.Host) *runtime.ExecutionResult + func (t *Transition) Commit() (Snapshot, types.Hash) + func (t *Transition) ContextPtr() *runtime.TxContext + func (t *Transition) Create2(caller types.Address, code []byte, value *big.Int, gas uint64) *runtime.ExecutionResult + func (t *Transition) EmitLog(addr types.Address, topics []types.Hash, data []byte) + func (t *Transition) Empty(addr types.Address) bool + func (t *Transition) GetBalance(addr types.Address) *big.Int + func (t *Transition) GetBlockHash(number int64) (res types.Hash) + func (t *Transition) GetCode(addr types.Address) []byte + func (t *Transition) GetCodeHash(addr types.Address) (res types.Hash) + func (t *Transition) GetCodeSize(addr types.Address) int + func (t *Transition) GetEVMLogger() runtime.EVMLogger + func (t *Transition) GetNonce(addr types.Address) uint64 + func (t *Transition) GetStorage(addr types.Address, key types.Hash) types.Hash + func (t *Transition) GetTxContext() runtime.TxContext + func (t *Transition) HookTotalGas(fn func() uint64) + func (t *Transition) IncreaseSystemTransactionGas(amount uint64) + func (t *Transition) Receipts() []*types.Receipt + func (t *Transition) Selfdestruct(addr types.Address, beneficiary types.Address) + func (t *Transition) SetAccountDirectly(addr types.Address, account *chain.GenesisAccount) error + func (t *Transition) SetEVMLogger(logger runtime.EVMLogger) + func (t *Transition) SetStorage(addr types.Address, key types.Hash, value types.Hash, ...) runtime.StorageStatus + func (t *Transition) SetTxn(txn *Txn) + func (t *Transition) TotalGas() uint64 + func (t *Transition) Txn() *Txn + func (t *Transition) Write(txn *types.Transaction) error + func (t *Transition) WriteFailedReceipt(txn *types.Transaction) error + type TransitionApplicationError struct + Err error + IsRecoverable bool + func NewTransitionApplicationError(err error, isRecoverable bool) *TransitionApplicationError + func (e *TransitionApplicationError) Error() string + type Txn struct + func NewTxn(state State, snapshot Snapshot) *Txn + func (txn *Txn) AddBalance(addr types.Address, balance *big.Int) + func (txn *Txn) AddLog(log *types.Log) + func (txn *Txn) AddRefund(gas uint64) + func (txn *Txn) AddSealingReward(addr types.Address, balance *big.Int) + func (txn *Txn) CleanDeleteObjects(deleteEmptyObjects bool) + func (txn *Txn) Commit(deleteEmptyObjects bool) []*Object + func (txn *Txn) CreateAccount(addr types.Address) + func (txn *Txn) EmitLog(addr types.Address, topics []types.Hash, data []byte) + func (txn *Txn) Empty(addr types.Address) bool + func (txn *Txn) Exist(addr types.Address) bool + func (txn *Txn) GetAccount(addr types.Address) (*Account, bool) + func (txn *Txn) GetBalance(addr types.Address) *big.Int + func (txn *Txn) GetCode(addr types.Address) []byte + func (txn *Txn) GetCodeHash(addr types.Address) types.Hash + func (txn *Txn) GetCodeSize(addr types.Address) int + func (txn *Txn) GetCommittedState(addr types.Address, key types.Hash) types.Hash + func (txn *Txn) GetNonce(addr types.Address) uint64 + func (txn *Txn) GetRefund() uint64 + func (txn *Txn) GetState(addr types.Address, key types.Hash) types.Hash + func (txn *Txn) HasSuicided(addr types.Address) bool + func (txn *Txn) IncrNonce(addr types.Address) + func (txn *Txn) Logs() []*types.Log + func (txn *Txn) RevertToSnapshot(id int) + func (txn *Txn) SetBalance(addr types.Address, balance *big.Int) + func (txn *Txn) SetCode(addr types.Address, code []byte) + func (txn *Txn) SetNonce(addr types.Address, nonce uint64) + func (txn *Txn) SetState(addr types.Address, key, value types.Hash) + func (txn *Txn) SetStorage(addr types.Address, key types.Hash, value types.Hash, ...) runtime.StorageStatus + func (txn *Txn) Snapshot() int + func (txn *Txn) SubBalance(addr types.Address, amount *big.Int) error + func (txn *Txn) SubRefund(gas uint64) + func (txn *Txn) Suicide(addr types.Address) bool + func (txn *Txn) TouchAccount(addr types.Address)