Documentation ¶
Index ¶
- Variables
- func CreateBloom(receipts EvmReceipts) *types.Bloom
- func NewEvmLogs() *evmLogs
- func NewMessageFromBxh(tx *pb.BxhTransaction) etherTypes.Message
- func NewSimpleLedger(repo *repo.Repo, ldb storage.Storage, accountCache *AccountCache, ...) (ledger.StateLedger, error)
- func OpenStateDB(file string, typ string) (stateStorage, error)
- type AccountCache
- type BlockData
- type BlockJournal
- type ChainLedgerImpl
- func (l *ChainLedgerImpl) Close()
- func (l *ChainLedgerImpl) GetBlock(height uint64) (*pb.Block, error)
- func (l *ChainLedgerImpl) GetBlockByHash(hash *types.Hash) (*pb.Block, error)
- func (l *ChainLedgerImpl) GetBlockHash(height uint64) *types.Hash
- func (l *ChainLedgerImpl) GetBlockSign(height uint64) ([]byte, error)
- func (l *ChainLedgerImpl) GetChainMeta() *pb.ChainMeta
- func (l *ChainLedgerImpl) GetInterchainMeta(height uint64) (*pb.InterchainMeta, error)
- func (l *ChainLedgerImpl) GetReceipt(hash *types.Hash) (*pb.Receipt, error)
- func (l *ChainLedgerImpl) GetTransaction(hash *types.Hash) (pb.Transaction, error)
- func (l *ChainLedgerImpl) GetTransactionCount(height uint64) (uint64, error)
- func (l *ChainLedgerImpl) GetTransactionMeta(hash *types.Hash) (*pb.TransactionMeta, error)
- func (l *ChainLedgerImpl) LoadChainMeta() *pb.ChainMeta
- func (l *ChainLedgerImpl) PersistExecutionResult(block *pb.Block, receipts []*pb.Receipt, interchainMeta *pb.InterchainMeta) error
- func (l *ChainLedgerImpl) PutBlock(height uint64, block *pb.Block) error
- func (l *ChainLedgerImpl) RollbackBlockChain(height uint64) error
- func (l *ChainLedgerImpl) UpdateChainMeta(meta *pb.ChainMeta)
- type EvmReceipts
- type Ledger
- type SimpleAccount
- func (o *SimpleAccount) AddBalance(amount *big.Int)
- func (o *SimpleAccount) AddState(key []byte, value []byte)
- func (o *SimpleAccount) Code() []byte
- func (o *SimpleAccount) CodeHash() []byte
- func (o *SimpleAccount) GetAddress() *types.Address
- func (o *SimpleAccount) GetBalance() *big.Int
- func (o *SimpleAccount) GetCommittedState(key []byte) []byte
- func (o *SimpleAccount) GetNonce() uint64
- func (o *SimpleAccount) GetState(key []byte) (bool, []byte)
- func (o *SimpleAccount) IsEmpty() bool
- func (o *SimpleAccount) Query(prefix string) (bool, [][]byte)
- func (o *SimpleAccount) SetBalance(balance *big.Int)
- func (o *SimpleAccount) SetCodeAndHash(code []byte)
- func (o *SimpleAccount) SetNonce(nonce uint64)
- func (o *SimpleAccount) SetState(key []byte, value []byte)
- func (o *SimpleAccount) SetSuicided(suicided bool)
- func (o *SimpleAccount) SubBalance(amount *big.Int)
- func (o *SimpleAccount) Suicided() bool
- type SimpleLedger
- func (l *SimpleLedger) AccountCache() *AccountCache
- func (l *SimpleLedger) AddAddressToAccessList(addr types.Address)
- func (l *SimpleLedger) AddAddressToEVMAccessList(addr common.Address)
- func (l *SimpleLedger) AddBalance(addr *types.Address, value *big.Int)
- func (l *SimpleLedger) AddEVMBalance(addr common.Address, amount *big.Int)
- func (l *SimpleLedger) AddEVMLog(log *etherTypes.Log)
- func (l *SimpleLedger) AddEVMPreimage(hash common.Hash, data []byte)
- func (l *SimpleLedger) AddEVMRefund(gas uint64)
- func (l *SimpleLedger) AddEvent(event *pb.Event)
- func (l *SimpleLedger) AddLog(log *pb.EvmLog)
- func (l *SimpleLedger) AddPreimage(hash types.Hash, preimage []byte)
- func (l *SimpleLedger) AddRefund(gas uint64)
- func (l *SimpleLedger) AddSlotToAccessList(addr types.Address, slot types.Hash)
- func (l *SimpleLedger) AddSlotToEVMAccessList(addr common.Address, slot common.Hash)
- func (l *SimpleLedger) AddState(addr *types.Address, key []byte, v []byte)
- func (l *SimpleLedger) AddressInAccessList(addr types.Address) bool
- func (l *SimpleLedger) AddressInEVMAccessList(addr common.Address) bool
- func (l *SimpleLedger) Clear()
- func (l *SimpleLedger) ClearChangerAndRefund()
- func (l *SimpleLedger) Close()
- func (l *SimpleLedger) Commit(height uint64, accounts map[string]ledger.IAccount, stateRoot *types.Hash) error
- func (l *SimpleLedger) Copy() ledger.StateLedger
- func (l *SimpleLedger) CreateEVMAccount(addr common.Address)
- func (l *SimpleLedger) Empty(addr *types.Address) bool
- func (l *SimpleLedger) EmptyEVM(addr common.Address) bool
- func (l *SimpleLedger) Events(txHash string) []*pb.Event
- func (l *SimpleLedger) Exist(addr *types.Address) bool
- func (l *SimpleLedger) ExistEVM(addr common.Address) bool
- func (l *SimpleLedger) Finalise(b bool)
- func (l *SimpleLedger) FlushDirtyData() (map[string]ledger.IAccount, *types.Hash)
- func (l *SimpleLedger) GetAccount(address *types.Address) ledger.IAccount
- func (l *SimpleLedger) GetBalance(addr *types.Address) *big.Int
- func (l *SimpleLedger) GetCode(addr *types.Address) []byte
- func (l *SimpleLedger) GetCodeHash(addr *types.Address) *types.Hash
- func (l *SimpleLedger) GetCodeSize(addr *types.Address) int
- func (l *SimpleLedger) GetCommittedState(addr *types.Address, key []byte) []byte
- func (l *SimpleLedger) GetEVMBalance(addr common.Address) *big.Int
- func (l *SimpleLedger) GetEVMCode(addr common.Address) []byte
- func (l *SimpleLedger) GetEVMCodeHash(addr common.Address) common.Hash
- func (l *SimpleLedger) GetEVMCodeSize(addr common.Address) int
- func (l *SimpleLedger) GetEVMCommittedState(addr common.Address, hash common.Hash) common.Hash
- func (l *SimpleLedger) GetEVMNonce(addr common.Address) uint64
- func (l *SimpleLedger) GetEVMRefund() uint64
- func (l *SimpleLedger) GetEVMState(addr common.Address, hash common.Hash) common.Hash
- func (l *SimpleLedger) GetLogs(hash types.Hash) []*pb.EvmLog
- func (l *SimpleLedger) GetNonce(addr *types.Address) uint64
- func (l *SimpleLedger) GetOrCreateAccount(addr *types.Address) ledger.IAccount
- func (l *SimpleLedger) GetRefund() uint64
- func (l *SimpleLedger) GetState(addr *types.Address, key []byte) (bool, []byte)
- func (l *SimpleLedger) HasSuiside(addr *types.Address) bool
- func (l *SimpleLedger) HasSuisideEVM(addr common.Address) bool
- func (l *SimpleLedger) Logs() []*pb.EvmLog
- func (l *SimpleLedger) PrepareAccessList(sender types.Address, dst *types.Address, precompiles []types.Address, ...)
- func (l *SimpleLedger) PrepareBlock(hash *types.Hash, height uint64)
- func (l *SimpleLedger) PrepareEVM(hash common.Hash, index int)
- func (l *SimpleLedger) PrepareEVMAccessList(sender common.Address, dest *common.Address, preEVMcompiles []common.Address, ...)
- func (l *SimpleLedger) QueryByPrefix(addr *types.Address, prefix string) (bool, [][]byte)
- func (l *SimpleLedger) RevertToSnapshot(revid int)
- func (l *SimpleLedger) RollbackState(height uint64) error
- func (l *SimpleLedger) SetBalance(addr *types.Address, value *big.Int)
- func (l *SimpleLedger) SetCode(addr *types.Address, code []byte)
- func (l *SimpleLedger) SetEVMCode(addr common.Address, code []byte)
- func (l *SimpleLedger) SetEVMNonce(addr common.Address, nonce uint64)
- func (l *SimpleLedger) SetEVMState(addr common.Address, key, value common.Hash)
- func (l *SimpleLedger) SetNonce(addr *types.Address, nonce uint64)
- func (l *SimpleLedger) SetState(addr *types.Address, key []byte, v []byte)
- func (l *SimpleLedger) SlotInAccessList(addr types.Address, slot types.Hash) (bool, bool)
- func (l *SimpleLedger) SlotInEVMAceessList(addr common.Address, slot common.Hash) (bool, bool)
- func (l *SimpleLedger) Snapshot() int
- func (l *SimpleLedger) StateDB() ledger2.StateDB
- func (l *SimpleLedger) SubBalance(addr *types.Address, value *big.Int)
- func (l *SimpleLedger) SubEVMBalance(addr common.Address, amount *big.Int)
- func (l *SimpleLedger) SubEVMRefund(gas uint64)
- func (l *SimpleLedger) SubRefund(gas uint64)
- func (l *SimpleLedger) Suiside(addr *types.Address) bool
- func (l *SimpleLedger) SuisideEVM(addr common.Address) bool
- func (l *SimpleLedger) Version() uint64
Constants ¶
This section is empty.
Variables ¶
var ( ErrorRollbackToHigherNumber = fmt.Errorf("rollback to higher blockchain height") ErrorRollbackWithoutJournal = fmt.Errorf("rollback to blockchain height without journal") ErrorRollbackTooMuch = fmt.Errorf("rollback too much block") ErrorRemoveJournalOutOfRange = fmt.Errorf("remove journal out of range") )
var ( PersistBlockDuration = prometheus.NewHistogram(prometheus.HistogramOpts{ Namespace: "bitxhub", Subsystem: "ledger", Name: "persist_block_duration_second", Help: "The total latency of block persist", Buckets: prometheus.ExponentialBuckets(0.001, 2, 10), }) )
Functions ¶
func CreateBloom ¶ added in v1.8.0
func CreateBloom(receipts EvmReceipts) *types.Bloom
func NewEvmLogs ¶ added in v1.8.0
func NewEvmLogs() *evmLogs
func NewMessageFromBxh ¶ added in v1.10.0
func NewMessageFromBxh(tx *pb.BxhTransaction) etherTypes.Message
func NewSimpleLedger ¶ added in v1.9.0
func NewSimpleLedger(repo *repo.Repo, ldb storage.Storage, accountCache *AccountCache, logger logrus.FieldLogger) (ledger.StateLedger, error)
New create a new ledger instance
func OpenStateDB ¶ added in v1.9.0
Types ¶
type AccountCache ¶
type AccountCache struct {
// contains filtered or unexported fields
}
func NewAccountCache ¶
func NewAccountCache() (*AccountCache, error)
type BlockJournal ¶
type ChainLedgerImpl ¶ added in v1.9.0
type ChainLedgerImpl struct {
// contains filtered or unexported fields
}
func NewChainLedgerImpl ¶ added in v1.9.0
func NewChainLedgerImpl(blockchainStore storage.Storage, bf *blockfile.BlockFile, repo *repo.Repo, logger logrus.FieldLogger) (*ChainLedgerImpl, error)
func (*ChainLedgerImpl) Close ¶ added in v1.9.0
func (l *ChainLedgerImpl) Close()
func (*ChainLedgerImpl) GetBlock ¶ added in v1.9.0
func (l *ChainLedgerImpl) GetBlock(height uint64) (*pb.Block, error)
GetBlock get block with height
func (*ChainLedgerImpl) GetBlockByHash ¶ added in v1.9.0
GetBlockByHash get the block using block hash
func (*ChainLedgerImpl) GetBlockHash ¶ added in v1.9.0
func (l *ChainLedgerImpl) GetBlockHash(height uint64) *types.Hash
func (*ChainLedgerImpl) GetBlockSign ¶ added in v1.9.0
func (l *ChainLedgerImpl) GetBlockSign(height uint64) ([]byte, error)
GetBlockSign get the signature of block
func (*ChainLedgerImpl) GetChainMeta ¶ added in v1.9.0
func (l *ChainLedgerImpl) GetChainMeta() *pb.ChainMeta
GetChainMeta get chain meta data
func (*ChainLedgerImpl) GetInterchainMeta ¶ added in v1.9.0
func (l *ChainLedgerImpl) GetInterchainMeta(height uint64) (*pb.InterchainMeta, error)
func (*ChainLedgerImpl) GetReceipt ¶ added in v1.9.0
GetReceipt get the transaction receipt
func (*ChainLedgerImpl) GetTransaction ¶ added in v1.9.0
func (l *ChainLedgerImpl) GetTransaction(hash *types.Hash) (pb.Transaction, error)
GetTransaction get the transaction using transaction hash
func (*ChainLedgerImpl) GetTransactionCount ¶ added in v1.9.0
func (l *ChainLedgerImpl) GetTransactionCount(height uint64) (uint64, error)
func (*ChainLedgerImpl) GetTransactionMeta ¶ added in v1.9.0
func (l *ChainLedgerImpl) GetTransactionMeta(hash *types.Hash) (*pb.TransactionMeta, error)
GetTransactionMeta get the transaction meta data
func (*ChainLedgerImpl) LoadChainMeta ¶ added in v1.9.0
func (l *ChainLedgerImpl) LoadChainMeta() *pb.ChainMeta
LoadChainMeta load chain meta data
func (*ChainLedgerImpl) PersistExecutionResult ¶ added in v1.9.0
func (l *ChainLedgerImpl) PersistExecutionResult(block *pb.Block, receipts []*pb.Receipt, interchainMeta *pb.InterchainMeta) error
PersistExecutionResult persist the execution result
func (*ChainLedgerImpl) PutBlock ¶ added in v1.9.0
func (l *ChainLedgerImpl) PutBlock(height uint64, block *pb.Block) error
PutBlock put block into store
func (*ChainLedgerImpl) RollbackBlockChain ¶ added in v1.9.0
func (l *ChainLedgerImpl) RollbackBlockChain(height uint64) error
func (*ChainLedgerImpl) UpdateChainMeta ¶ added in v1.9.0
func (l *ChainLedgerImpl) UpdateChainMeta(meta *pb.ChainMeta)
UpdateChainMeta update the chain meta data
type EvmReceipts ¶ added in v1.8.0
type Ledger ¶
type Ledger struct { ledger.ChainLedger ledger.StateLedger }
func (*Ledger) PersistBlockData ¶
PersistBlockData persists block data
type SimpleAccount ¶ added in v1.9.0
func (*SimpleAccount) AddBalance ¶ added in v1.9.0
func (o *SimpleAccount) AddBalance(amount *big.Int)
func (*SimpleAccount) AddState ¶ added in v1.9.0
func (o *SimpleAccount) AddState(key []byte, value []byte)
AddState Add account state
func (*SimpleAccount) Code ¶ added in v1.9.0
func (o *SimpleAccount) Code() []byte
Code return the contract code
func (*SimpleAccount) CodeHash ¶ added in v1.9.0
func (o *SimpleAccount) CodeHash() []byte
func (*SimpleAccount) GetAddress ¶ added in v1.9.0
func (o *SimpleAccount) GetAddress() *types.Address
func (*SimpleAccount) GetBalance ¶ added in v1.9.0
func (o *SimpleAccount) GetBalance() *big.Int
GetBalance Get the balance from the account
func (*SimpleAccount) GetCommittedState ¶ added in v1.9.0
func (o *SimpleAccount) GetCommittedState(key []byte) []byte
func (*SimpleAccount) GetNonce ¶ added in v1.9.0
func (o *SimpleAccount) GetNonce() uint64
GetNonce Get the nonce from user account
func (*SimpleAccount) GetState ¶ added in v1.9.0
func (o *SimpleAccount) GetState(key []byte) (bool, []byte)
GetState Get state from local cache, if not found, then get it from DB
func (*SimpleAccount) IsEmpty ¶ added in v1.9.0
func (o *SimpleAccount) IsEmpty() bool
func (*SimpleAccount) Query ¶ added in v1.9.0
func (o *SimpleAccount) Query(prefix string) (bool, [][]byte)
Query Query the value using key
func (*SimpleAccount) SetBalance ¶ added in v1.9.0
func (o *SimpleAccount) SetBalance(balance *big.Int)
SetBalance Set the balance to the account
func (*SimpleAccount) SetCodeAndHash ¶ added in v1.9.0
func (o *SimpleAccount) SetCodeAndHash(code []byte)
SetCodeAndHash Set the contract code and hash
func (*SimpleAccount) SetNonce ¶ added in v1.9.0
func (o *SimpleAccount) SetNonce(nonce uint64)
SetNonce Set the nonce which indicates the contract number
func (*SimpleAccount) SetState ¶ added in v1.9.0
func (o *SimpleAccount) SetState(key []byte, value []byte)
SetState Set account state
func (*SimpleAccount) SetSuicided ¶ added in v1.9.0
func (o *SimpleAccount) SetSuicided(suicided bool)
func (*SimpleAccount) SubBalance ¶ added in v1.9.0
func (o *SimpleAccount) SubBalance(amount *big.Int)
func (*SimpleAccount) Suicided ¶ added in v1.9.0
func (o *SimpleAccount) Suicided() bool
type SimpleLedger ¶ added in v1.9.0
type SimpleLedger struct {
// contains filtered or unexported fields
}
func (*SimpleLedger) AccountCache ¶ added in v1.9.0
func (l *SimpleLedger) AccountCache() *AccountCache
func (*SimpleLedger) AddAddressToAccessList ¶ added in v1.9.0
func (l *SimpleLedger) AddAddressToAccessList(addr types.Address)
func (*SimpleLedger) AddAddressToEVMAccessList ¶ added in v1.9.0
func (l *SimpleLedger) AddAddressToEVMAccessList(addr common.Address)
func (*SimpleLedger) AddBalance ¶ added in v1.9.0
func (l *SimpleLedger) AddBalance(addr *types.Address, value *big.Int)
func (*SimpleLedger) AddEVMBalance ¶ added in v1.9.0
func (l *SimpleLedger) AddEVMBalance(addr common.Address, amount *big.Int)
func (*SimpleLedger) AddEVMLog ¶ added in v1.9.0
func (l *SimpleLedger) AddEVMLog(log *etherTypes.Log)
func (*SimpleLedger) AddEVMPreimage ¶ added in v1.9.0
func (l *SimpleLedger) AddEVMPreimage(hash common.Hash, data []byte)
func (*SimpleLedger) AddEVMRefund ¶ added in v1.9.0
func (l *SimpleLedger) AddEVMRefund(gas uint64)
func (*SimpleLedger) AddEvent ¶ added in v1.9.0
func (l *SimpleLedger) AddEvent(event *pb.Event)
AddEvent add ledger event
func (*SimpleLedger) AddLog ¶ added in v1.9.0
func (l *SimpleLedger) AddLog(log *pb.EvmLog)
func (*SimpleLedger) AddPreimage ¶ added in v1.9.0
func (l *SimpleLedger) AddPreimage(hash types.Hash, preimage []byte)
func (*SimpleLedger) AddRefund ¶ added in v1.9.0
func (l *SimpleLedger) AddRefund(gas uint64)
func (*SimpleLedger) AddSlotToAccessList ¶ added in v1.9.0
func (l *SimpleLedger) AddSlotToAccessList(addr types.Address, slot types.Hash)
func (*SimpleLedger) AddSlotToEVMAccessList ¶ added in v1.9.0
func (l *SimpleLedger) AddSlotToEVMAccessList(addr common.Address, slot common.Hash)
func (*SimpleLedger) AddState ¶ added in v1.9.0
func (l *SimpleLedger) AddState(addr *types.Address, key []byte, v []byte)
AddState add account state value using account Address and key
func (*SimpleLedger) AddressInAccessList ¶ added in v1.9.0
func (l *SimpleLedger) AddressInAccessList(addr types.Address) bool
func (*SimpleLedger) AddressInEVMAccessList ¶ added in v1.9.0
func (l *SimpleLedger) AddressInEVMAccessList(addr common.Address) bool
func (*SimpleLedger) Clear ¶ added in v1.9.0
func (l *SimpleLedger) Clear()
func (*SimpleLedger) ClearChangerAndRefund ¶ added in v1.9.0
func (l *SimpleLedger) ClearChangerAndRefund()
func (*SimpleLedger) Close ¶ added in v1.9.0
func (l *SimpleLedger) Close()
Close close the ledger instance
func (*SimpleLedger) Commit ¶ added in v1.9.0
func (l *SimpleLedger) Commit(height uint64, accounts map[string]ledger.IAccount, stateRoot *types.Hash) error
Commit commit the state
func (*SimpleLedger) Copy ¶ added in v1.10.0
func (l *SimpleLedger) Copy() ledger.StateLedger
func (*SimpleLedger) CreateEVMAccount ¶ added in v1.9.0
func (l *SimpleLedger) CreateEVMAccount(addr common.Address)
func (*SimpleLedger) EmptyEVM ¶ added in v1.9.0
func (l *SimpleLedger) EmptyEVM(addr common.Address) bool
func (*SimpleLedger) Events ¶ added in v1.9.0
func (l *SimpleLedger) Events(txHash string) []*pb.Event
Events return ledger events
func (*SimpleLedger) ExistEVM ¶ added in v1.9.0
func (l *SimpleLedger) ExistEVM(addr common.Address) bool
func (*SimpleLedger) Finalise ¶ added in v1.9.0
func (l *SimpleLedger) Finalise(b bool)
func (*SimpleLedger) FlushDirtyData ¶ added in v1.10.0
FlushDirtyData gets dirty accounts and computes block journal
func (*SimpleLedger) GetAccount ¶ added in v1.9.0
func (l *SimpleLedger) GetAccount(address *types.Address) ledger.IAccount
GetAccount get account info using account Address, if not found, create a new account
func (*SimpleLedger) GetBalance ¶ added in v1.9.0
func (l *SimpleLedger) GetBalance(addr *types.Address) *big.Int
GetBalanec get account balance using account Address
func (*SimpleLedger) GetCode ¶ added in v1.9.0
func (l *SimpleLedger) GetCode(addr *types.Address) []byte
GetCode get contract code
func (*SimpleLedger) GetCodeHash ¶ added in v1.9.0
func (l *SimpleLedger) GetCodeHash(addr *types.Address) *types.Hash
func (*SimpleLedger) GetCodeSize ¶ added in v1.9.0
func (l *SimpleLedger) GetCodeSize(addr *types.Address) int
func (*SimpleLedger) GetCommittedState ¶ added in v1.9.0
func (l *SimpleLedger) GetCommittedState(addr *types.Address, key []byte) []byte
func (*SimpleLedger) GetEVMBalance ¶ added in v1.9.0
func (l *SimpleLedger) GetEVMBalance(addr common.Address) *big.Int
func (*SimpleLedger) GetEVMCode ¶ added in v1.9.0
func (l *SimpleLedger) GetEVMCode(addr common.Address) []byte
func (*SimpleLedger) GetEVMCodeHash ¶ added in v1.9.0
func (l *SimpleLedger) GetEVMCodeHash(addr common.Address) common.Hash
func (*SimpleLedger) GetEVMCodeSize ¶ added in v1.9.0
func (l *SimpleLedger) GetEVMCodeSize(addr common.Address) int
func (*SimpleLedger) GetEVMCommittedState ¶ added in v1.9.0
func (*SimpleLedger) GetEVMNonce ¶ added in v1.9.0
func (l *SimpleLedger) GetEVMNonce(addr common.Address) uint64
func (*SimpleLedger) GetEVMRefund ¶ added in v1.9.0
func (l *SimpleLedger) GetEVMRefund() uint64
func (*SimpleLedger) GetEVMState ¶ added in v1.9.0
func (*SimpleLedger) GetLogs ¶ added in v1.9.0
func (l *SimpleLedger) GetLogs(hash types.Hash) []*pb.EvmLog
func (*SimpleLedger) GetNonce ¶ added in v1.9.0
func (l *SimpleLedger) GetNonce(addr *types.Address) uint64
GetNonce get account nonce
func (*SimpleLedger) GetOrCreateAccount ¶ added in v1.9.0
func (l *SimpleLedger) GetOrCreateAccount(addr *types.Address) ledger.IAccount
GetOrCreateAccount get the account, if not exist, create a new account
func (*SimpleLedger) GetRefund ¶ added in v1.9.0
func (l *SimpleLedger) GetRefund() uint64
func (*SimpleLedger) GetState ¶ added in v1.9.0
GetState get account state value using account Address and key
func (*SimpleLedger) HasSuiside ¶ added in v1.9.0
func (l *SimpleLedger) HasSuiside(addr *types.Address) bool
func (*SimpleLedger) HasSuisideEVM ¶ added in v1.9.0
func (l *SimpleLedger) HasSuisideEVM(addr common.Address) bool
func (*SimpleLedger) Logs ¶ added in v1.9.0
func (l *SimpleLedger) Logs() []*pb.EvmLog
func (*SimpleLedger) PrepareAccessList ¶ added in v1.9.0
func (l *SimpleLedger) PrepareAccessList(sender types.Address, dst *types.Address, precompiles []types.Address, list ledger.AccessTupleList)
func (*SimpleLedger) PrepareBlock ¶ added in v1.9.0
func (l *SimpleLedger) PrepareBlock(hash *types.Hash, height uint64)
func (*SimpleLedger) PrepareEVM ¶ added in v1.9.0
func (l *SimpleLedger) PrepareEVM(hash common.Hash, index int)
func (*SimpleLedger) PrepareEVMAccessList ¶ added in v1.9.0
func (l *SimpleLedger) PrepareEVMAccessList(sender common.Address, dest *common.Address, preEVMcompiles []common.Address, txEVMAccesses etherTypes.AccessList)
func (*SimpleLedger) QueryByPrefix ¶ added in v1.9.0
QueryByPrefix query value using key
func (*SimpleLedger) RevertToSnapshot ¶ added in v1.9.0
func (l *SimpleLedger) RevertToSnapshot(revid int)
func (*SimpleLedger) RollbackState ¶ added in v1.9.0
func (l *SimpleLedger) RollbackState(height uint64) error
func (*SimpleLedger) SetBalance ¶ added in v1.9.0
func (l *SimpleLedger) SetBalance(addr *types.Address, value *big.Int)
SetBalance set account balance
func (*SimpleLedger) SetCode ¶ added in v1.9.0
func (l *SimpleLedger) SetCode(addr *types.Address, code []byte)
SetCode set contract code
func (*SimpleLedger) SetEVMCode ¶ added in v1.9.0
func (l *SimpleLedger) SetEVMCode(addr common.Address, code []byte)
func (*SimpleLedger) SetEVMNonce ¶ added in v1.9.0
func (l *SimpleLedger) SetEVMNonce(addr common.Address, nonce uint64)
func (*SimpleLedger) SetEVMState ¶ added in v1.9.0
func (l *SimpleLedger) SetEVMState(addr common.Address, key, value common.Hash)
func (*SimpleLedger) SetNonce ¶ added in v1.9.0
func (l *SimpleLedger) SetNonce(addr *types.Address, nonce uint64)
SetNonce set account nonce
func (*SimpleLedger) SetState ¶ added in v1.9.0
func (l *SimpleLedger) SetState(addr *types.Address, key []byte, v []byte)
SetState set account state value using account Address and key
func (*SimpleLedger) SlotInAccessList ¶ added in v1.9.0
func (*SimpleLedger) SlotInEVMAceessList ¶ added in v1.9.0
func (*SimpleLedger) Snapshot ¶ added in v1.9.0
func (l *SimpleLedger) Snapshot() int
func (*SimpleLedger) StateDB ¶ added in v1.9.0
func (l *SimpleLedger) StateDB() ledger2.StateDB
func (*SimpleLedger) SubBalance ¶ added in v1.9.0
func (l *SimpleLedger) SubBalance(addr *types.Address, value *big.Int)
func (*SimpleLedger) SubEVMBalance ¶ added in v1.9.0
func (l *SimpleLedger) SubEVMBalance(addr common.Address, amount *big.Int)
func (*SimpleLedger) SubEVMRefund ¶ added in v1.9.0
func (l *SimpleLedger) SubEVMRefund(gas uint64)
func (*SimpleLedger) SubRefund ¶ added in v1.9.0
func (l *SimpleLedger) SubRefund(gas uint64)
func (*SimpleLedger) Suiside ¶ added in v1.9.0
func (l *SimpleLedger) Suiside(addr *types.Address) bool
func (*SimpleLedger) SuisideEVM ¶ added in v1.9.0
func (l *SimpleLedger) SuisideEVM(addr common.Address) bool
func (*SimpleLedger) Version ¶ added in v1.9.0
func (l *SimpleLedger) Version() uint64
Version returns the current version
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_ledger is a generated GoMock package.
|
Package mock_ledger is a generated GoMock package. |