Documentation ¶
Index ¶
- type ApplyContext
- type Config
- type Opt
- type Request
- type VM
- func (v *VM) AccountExists(address core.Address) (bool, error)
- func (v *VM) Apply(lctx ApplyContext, txs []types.Transaction, ...) ([]types.Transaction, []types.TransactionWithResult, error)
- func (v *VM) ApplyGenesis(genesis []types.Account) error
- func (v *VM) GetAllAccounts() ([]*types.Account, error)
- func (v *VM) GetBalance(address types.Address) (uint64, error)
- func (v *VM) GetLayerApplied(tid types.TransactionID) (types.LayerID, error)
- func (v *VM) GetLayerStateRoot(lid types.LayerID) (types.Hash32, error)
- func (v *VM) GetNonce(address core.Address) (core.Nonce, error)
- func (v *VM) GetStateRoot() (types.Hash32, error)
- func (v *VM) Revert(lid types.LayerID) error
- func (v *VM) Validation(raw types.RawTx) system.ValidationRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyContext ¶
ApplyContext has information on layer and block id.
type Config ¶
type Config struct { GasLimit uint64 GenesisID types.Hash20 StorageCostFactor uint64 `mapstructure:"vm-storage-cost-factor"` }
Config defines the configuration options for vm.
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request used to implement 2-step validation flow. After Parse is executed - conservative cache may do validation and skip Verify if transaction can't be executed.
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
VM handles modifications to the account state.
func (*VM) AccountExists ¶
AccountExists returns true if the address exists, spawned or not.
func (*VM) Apply ¶
func (v *VM) Apply(lctx ApplyContext, txs []types.Transaction, blockRewards []types.CoinbaseReward) ([]types.Transaction, []types.TransactionWithResult, error)
Apply transactions.
func (*VM) ApplyGenesis ¶
ApplyGenesis saves list of accounts for genesis.
func (*VM) GetAllAccounts ¶
GetAllAccounts returns a dump of all accounts in global state.
func (*VM) GetBalance ¶
GetBalance returns balance for an address.
func (*VM) GetLayerApplied ¶
GetLayerApplied returns layer of the applied transaction.
func (*VM) GetLayerStateRoot ¶
GetLayerStateRoot returns the state root at a given layer.
func (*VM) GetStateRoot ¶
GetStateRoot gets the current state root hash.
func (*VM) Validation ¶
func (v *VM) Validation(raw types.RawTx) system.ValidationRequest
Validation initializes validation request.