Documentation
¶
Index ¶
- func GenerateAddress() common.Address
- func GenerateHash() common.Hash
- func NewAddrKey() (common.Address, *ethsecp256k1.PrivKey)
- type AccessList2
- func (al *AccessList2) AddAddress(address common.Address) bool
- func (al *AccessList2) AddSlot(address common.Address, slot common.Hash) (addrChange bool, slotChange bool)
- func (al *AccessList2) CloneElements() map[common.Address]map[common.Hash]bool
- func (al *AccessList2) Contains(address common.Address, slot common.Hash) (addressPresent bool, slotPresent bool)
- func (al *AccessList2) ContainsAddress(address common.Address) bool
- func (al *AccessList2) Copy() *AccessList2
- func (al *AccessList2) DeleteAddress(address common.Address)
- func (al *AccessList2) DeleteSlot(address common.Address, slot common.Hash)
- type AccountTracker
- type CStateDB
- type EVMConfig
- type EvmKeeper
- type Logs
- type RtStateDbSnapshot
- type TransientStorage
- type TxConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAddress ¶
GenerateAddress generates an Ethereum address.
func NewAddrKey ¶
func NewAddrKey() (common.Address, *ethsecp256k1.PrivKey)
NewAddrKey generates an Ethereum address and its corresponding private key.
Types ¶
type AccessList2 ¶
type AccessList2 struct {
// contains filtered or unexported fields
}
AccessList2 has the same functionality as the accessList in go-ethereum. But different implementation in order to perform a deep copy to match with the implementation of Snapshot and RevertToSnapshot.
func (*AccessList2) AddAddress ¶
func (al *AccessList2) AddAddress(address common.Address) bool
AddAddress adds an address to the access list, and returns 'true' if the operation caused a change (addr was not previously in the list).
func (*AccessList2) AddSlot ¶
func (al *AccessList2) AddSlot(address common.Address, slot common.Hash) (addrChange bool, slotChange bool)
AddSlot adds the specified (addr, slot) combo to the access list. Return values are: - address added - slot added
func (*AccessList2) CloneElements ¶
func (*AccessList2) Contains ¶
func (al *AccessList2) Contains(address common.Address, slot common.Hash) (addressPresent bool, slotPresent bool)
Contains checks if a slot within an account is present in the access list, returning separate flags for the presence of the account and the slot respectively.
func (*AccessList2) ContainsAddress ¶
func (al *AccessList2) ContainsAddress(address common.Address) bool
ContainsAddress returns true if the address is in the access list.
func (*AccessList2) Copy ¶
func (al *AccessList2) Copy() *AccessList2
Copy creates an independent copy of an AccessList2.
func (*AccessList2) DeleteAddress ¶
func (al *AccessList2) DeleteAddress(address common.Address)
DeleteAddress removes an address from the access list.
func (*AccessList2) DeleteSlot ¶
func (al *AccessList2) DeleteSlot(address common.Address, slot common.Hash)
DeleteSlot removes an (address, slot)-tuple from the access list.
type AccountTracker ¶
func (AccountTracker) Add ¶
func (t AccountTracker) Add(addr common.Address)
func (AccountTracker) Copy ¶
func (t AccountTracker) Copy() AccountTracker
func (AccountTracker) Delete ¶
func (t AccountTracker) Delete(addr common.Address)
type CStateDB ¶
type CStateDB interface {
corevm.StateDB
GetTransactionLogs() []*ethtypes.Log
CommitMultiStore(deleteEmptyObjects bool) error
IntermediateRoot(deleteEmptyObjects bool) (common.Hash, error)
GetCurrentContext() sdk.Context
DestroyAccount(acc common.Address)
Selfdestruct6780(address common.Address)
GetTransientState(addr common.Address, key common.Hash) common.Hash
SetTransientState(addr common.Address, key, value common.Hash)
ForTest_AddAddressToSelfDestructedList(addr common.Address)
ForTest_SetLogs(logs Logs)
ForTest_CountRecordsTransientStorage() int
ForTest_CloneTransientStorage() TransientStorage
ForTest_CloneAccessList() *AccessList2
ForTest_CloneTouched() AccountTracker
ForTest_CloneSelfDestructed() AccountTracker
ForTest_GetSnapshots() []RtStateDbSnapshot
ForTest_ToggleStateDBPreventCommit(prevent bool)
ForTest_GetOriginalContext() sdk.Context
ForTest_GetEvmDenom() string
ForTest_IsCommitted() bool
}
CStateDB is an interface that extends the vm.StateDB interface with additional methods. The implementation is Context-based, and the name CStateDB stands for Context-based-StateDB.
func NewStateDB ¶
func NewStateDB( ctx sdk.Context, coinbase common.Address, ethKeeper EvmKeeper, accountKeeper authkeeper.AccountKeeper, bankKeeper bankkeeper.Keeper, ) CStateDB
type EVMConfig ¶
type EVMConfig struct {
Params evmtypes.Params
ChainConfig *ethparams.ChainConfig
CoinBase common.Address
BaseFee *big.Int
NoBaseFee bool
}
EVMConfig contains the needed information to initialize core VM
type EvmKeeper ¶
type EvmKeeper interface {
GetParams(ctx sdk.Context) (params evmtypes.Params)
GetEip155ChainId(ctx sdk.Context) evmtypes.Eip155ChainId
ForEachStorage(ctx sdk.Context, addr common.Address, cb func(key, value common.Hash) bool)
DeleteCodeHash(ctx sdk.Context, addr []byte)
SetState(ctx sdk.Context, addr common.Address, key common.Hash, value []byte)
GetCodeHash(ctx sdk.Context, addr []byte) common.Hash
GetCode(ctx sdk.Context, codeHash common.Hash) []byte
SetCode(ctx sdk.Context, codeHash, code []byte)
SetCodeHash(ctx sdk.Context, addr common.Address, codeHash common.Hash)
GetState(ctx sdk.Context, addr common.Address, key common.Hash) common.Hash
IsEmptyAccount(ctx sdk.Context, addr common.Address) bool
}
type RtStateDbSnapshot ¶
type RtStateDbSnapshot struct {
// contains filtered or unexported fields
}
RtStateDbSnapshot is a snapshot of the state of the entire state database at a particular point in time.
CONTRACT: snapshot & revert must perform deep clone of the underlying state.
func (RtStateDbSnapshot) GetID ¶
func (s RtStateDbSnapshot) GetID() int
func (RtStateDbSnapshot) WriteChanges ¶
func (s RtStateDbSnapshot) WriteChanges()
WriteChanges commit any changes made to the snapshot cache-multi-store to the parent cache-multi-store.
type TransientStorage ¶
type TransientStorage interface {
Set(addr common.Address, key, value common.Hash)
Get(addr common.Address, key common.Hash) common.Hash
Clone() TransientStorage
Size() int
}
TransientStorage is an interface for the transient storage. We use this interface instead of export the un-exported type transientStorage because we would like to avoid changing much of the existing code so that we can compare the code change easily.