Documentation ¶
Index ¶
- Constants
- func AssertValidKey(key []byte)
- func AssertValidValue(value []byte)
- func EndKey(startKey []byte) (endKey []byte)
- func FileExist(path string) bool
- func IsValidaWasmFile(code []byte) error
- func IsWasm(input []byte) bool
- func MakeCodeHash(code []byte) []byte
- func NewHandler(k *Keeper) sdk.Handler
- func NewQuerier(k Keeper) sdk.Querier
- func UnCompress(src []byte) ([]byte, error)
- type Address
- type DatabaseIter
- type Event
- type Generator
- type Keeper
- func (k *Keeper) AddBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)
- func (k *Keeper) AddLog(ctx sdk.Context, log *ethtypes.Log)
- func (k *Keeper) AddPreimage(ctx sdk.Context, hash ethcmn.Hash, preimage []byte)
- func (k *Keeper) AddRefund(ctx sdk.Context, gas uint64)
- func (k *Keeper) AllLogs(ctx sdk.Context) []*ethtypes.Log
- func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (k *Keeper) BlockHash(ctx sdk.Context) ethcmn.Hash
- func (k *Keeper) ClearStateObjects(ctx sdk.Context)
- func (k *Keeper) Commit(ctx sdk.Context, deleteEmptyObjects bool) (root ethcmn.Hash, err error)
- func (k *Keeper) Copy(ctx sdk.Context) ethvm.StateDB
- func (k *Keeper) CreateAccount(ctx sdk.Context, addr ethcmn.Address)
- func (k *Keeper) Database(ctx sdk.Context) ethstate.Database
- func (k *Keeper) DeleteLogs(ctx sdk.Context, hash ethcmn.Hash)
- func (k *Keeper) Empty(ctx sdk.Context, addr ethcmn.Address) bool
- func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
- func (k *Keeper) Error(ctx sdk.Context) error
- func (k *Keeper) Execute(ctx sdk.Context, contractAddress sdk.AccAddress, invoker sdk.AccAddress, ...) (sdk.Result, error)
- func (k *Keeper) Exist(ctx sdk.Context, addr ethcmn.Address) bool
- func (k *Keeper) Finalise(ctx sdk.Context, deleteEmptyObjects bool) error
- func (k *Keeper) ForEachStorage(ctx sdk.Context, addr ethcmn.Address, cb func(key, value ethcmn.Hash) bool) error
- func (k *Keeper) GetAccountStorage(ctx sdk.Context, address common.Address) (evmtypes.Storage, error)
- func (k *Keeper) GetAllTxLogs(ctx sdk.Context) []evmtypes.TransactionLogs
- func (k *Keeper) GetBalance(ctx sdk.Context, addr ethcmn.Address) *big.Int
- func (k *Keeper) GetBlockBloom(ctx sdk.Context, height int64) (ethtypes.Bloom, bool)
- func (k *Keeper) GetBlockHash(ctx sdk.Context, hash []byte) (int64, bool)
- func (k *Keeper) GetChainConfig(ctx sdk.Context) (evmtypes.ChainConfig, bool)
- func (k *Keeper) GetCode(ctx sdk.Context, addr ethcmn.Address) []byte
- func (k *Keeper) GetCodeHash(ctx sdk.Context, addr ethcmn.Address) ethcmn.Hash
- func (k Keeper) GetCodeInfo(ctx sdk.Context, codeHash []byte) *types.CodeInfo
- func (k *Keeper) GetCodeSize(ctx sdk.Context, addr ethcmn.Address) int
- func (k *Keeper) GetCommittedState(ctx sdk.Context, addr ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash
- func (k Keeper) GetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) *types.ContractInfo
- func (k Keeper) GetCreator(ctx sdk.Context, contractAddress sdk.AccAddress) sdk.AccAddress
- func (k *Keeper) GetLogs(ctx sdk.Context, hash ethcmn.Hash) ([]*ethtypes.Log, error)
- func (k *Keeper) GetNonce(ctx sdk.Context, addr ethcmn.Address) uint64
- func (k *Keeper) GetOrNewStateObject(ctx sdk.Context, addr ethcmn.Address) evmtypes.StateObject
- func (k *Keeper) GetParams(ctx sdk.Context) (params evmtypes.Params)
- func (k *Keeper) GetRefund(ctx sdk.Context) uint64
- func (k *Keeper) GetSectionBloom(ctx sdk.Context, index int64) (*Generator, bool)
- func (k *Keeper) GetState(ctx sdk.Context, addr ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash
- func (k *Keeper) HasSuicided(ctx sdk.Context, addr ethcmn.Address) bool
- func (k *Keeper) Instantiate(ctx sdk.Context, codeHash []byte, invoker sdk.AccAddress, args utils.WasmInput, ...) (sdk.AccAddress, error)
- func (k *Keeper) IntermediateRoot(ctx sdk.Context, deleteEmptyObjects bool) error
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) Migrate(ctx sdk.Context, codeHash []byte, invoker sdk.AccAddress, ...) (sdk.AccAddress, error)
- func (k *Keeper) Preimages(ctx sdk.Context) map[ethcmn.Hash][]byte
- func (k *Keeper) Prepare(ctx sdk.Context, thash, bhash ethcmn.Hash, txi int)
- func (k Keeper) Query(ctx sdk.Context, contractAddress, invoker sdk.AccAddress, args utils.WasmInput) (types.ContractState, error)
- func (k *Keeper) RecordSection(ctx sdk.Context, height int64, bloom ethtypes.Bloom)
- func (k *Keeper) Reset(ctx sdk.Context, root ethcmn.Hash) error
- func (k *Keeper) RevertToSnapshot(ctx sdk.Context, revID int)
- func (k *Keeper) SetBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)
- func (k *Keeper) SetBlockBloom(ctx sdk.Context, height int64, bloom ethtypes.Bloom)
- func (k *Keeper) SetBlockHash(ctx sdk.Context, hash []byte, height int64)
- func (k *Keeper) SetChainConfig(ctx sdk.Context, config evmtypes.ChainConfig)
- func (k *Keeper) SetCode(ctx sdk.Context, addr ethcmn.Address, code []byte)
- func (k Keeper) SetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress, contract types.ContractInfo)
- func (k *Keeper) SetLogs(ctx sdk.Context, hash ethcmn.Hash, logs []*ethtypes.Log) error
- func (k *Keeper) SetNonce(ctx sdk.Context, addr ethcmn.Address, nonce uint64)
- func (k *Keeper) SetParams(ctx sdk.Context, params evmtypes.Params)
- func (k *Keeper) SetSectionBloom(ctx sdk.Context, index int64, gen *Generator)
- func (k *Keeper) SetState(ctx sdk.Context, addr ethcmn.Address, key, value ethcmn.Hash)
- func (k *Keeper) Snapshot(ctx sdk.Context) int
- func (k *Keeper) StorageTrie(ctx sdk.Context, addr ethcmn.Address) ethstate.Trie
- func (k *Keeper) SubBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)
- func (k *Keeper) SubRefund(ctx sdk.Context, gas uint64)
- func (k *Keeper) Suicide(ctx sdk.Context, addr ethcmn.Address) bool
- func (k *Keeper) TxIndex(ctx sdk.Context) int
- func (k *Keeper) UpdateAccounts(ctx sdk.Context)
- func (k *Keeper) Upload(ctx sdk.Context, wasmCode []byte, creator sdk.AccAddress) (codeHash []byte, err error)
- type QueryETHLogs
- type QueryResBlockNumber
- type Sink
- func (sink Sink) Bytes() []byte
- func (sink Sink) ReadBool() (bool, error)
- func (sink Sink) ReadByte() (byte, error)
- func (sink Sink) ReadBytes() ([]byte, int, error)
- func (sink Sink) ReadI64() (result int64, err error)
- func (sink Sink) ReadString() (string, error)
- func (sink Sink) ReadU32() (result uint32, err error)
- func (sink Sink) WriteAddress(addr Address)
- func (sink Sink) WriteBytes(b []byte)
- func (sink Sink) WriteI32(i int32)
- func (sink Sink) WriteI64(i int64)
- func (sink Sink) WriteString(s string)
- func (sink Sink) WriteU128(u *types.RustU128)
- func (sink Sink) WriteU32(i uint32)
- func (sink Sink) WriteU64(i uint64)
- type SortMap
- type SortMaps
- type Store
- type VMRes
- type Wasmer
- type WasmerContext
Constants ¶
const ( WASMDIR = "/wasm/" AddressSize = 20 )
const ( EventAttrValueTypeInt64 = 0 EventAttrValueTypeString = 1 )
const ( InputDataTypeParam = 0 InputDataTypeContractResult = 1 )
const CAN_MIGRATE string = "canMigrate"
const CAN_MIGRATE_RESULT string = "true"
const INIT string = "init"
const INVOKE string = "invoke"
const (
InstantiateFuncName = "init"
)
const UINT_MAX uint64 = ^uint64(0)
Variables ¶
This section is empty.
Functions ¶
func AssertValidValue ¶
func AssertValidValue(value []byte)
Check if the value is valid(value is not nil)
func IsValidaWasmFile ¶
func MakeCodeHash ¶
func NewHandler ¶
func NewQuerier ¶
func UnCompress ¶
Types ¶
type DatabaseIter ¶
type Event ¶
func NewEventFromSlice ¶
type Generator ¶
type Generator struct { Blooms [ethtypes.BloomBitLength][]byte `json:"blooms"` // Rotated blooms for per-bit matching Sections uint `json:"sections"` // Number of sections to batch together }
Generator takes a number of bloom filters and generates the rotated bloom bits to be used for batched filtering.
func NewGenerator ¶
NewGenerator creates a rotated bloom generator that can iteratively fill a batched bloom filter's bits.
type Keeper ¶
type Keeper struct { AccountKeeper account.AccountKeeper StakingKeeper keeper2.StakingKeeper // Ethermint concrete implementation on the EVM StateDB interface CommitStateDB *evmtypes.CommitStateDB // Transaction counter in a block. Used on StateSB's Prepare function. // It is reset to 0 every block on BeginBlock so there's no point in storing the counter // on the KVStore or adding it as a field on the EVM genesis state. TxCount int Bloom *big.Int // contains filtered or unexported fields }
func (*Keeper) AddBalance ¶
AddBalance calls CommitStateDB.AddBalance using the passed in context
func (*Keeper) AddPreimage ¶
AddPreimage calls CommitStateDB.AddPreimage using the passed in context
func (*Keeper) BeginBlock ¶
func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
BeginBlock sets the block hash -> block height map for the previous block height and resets the Bloom filter and the transaction count to 0.
func (*Keeper) ClearStateObjects ¶
ClearStateObjects calls CommitStateDB.ClearStateObjects using the passed in context
func (*Keeper) CreateAccount ¶
CreateAccount calls CommitStateDB.CreateAccount using the passed in context
func (*Keeper) DeleteLogs ¶
DeleteLogs calls CommitStateDB.DeleteLogs using the passed in context
func (*Keeper) EndBlock ¶
func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock updates the accounts and commits state objects to the KV Store, while deleting the empty ones. It also sets the bloom filers for the request block to the store. The EVM end block loginc doesn't update the validator set, thus it returns an empty slice.
func (*Keeper) ForEachStorage ¶
func (k *Keeper) ForEachStorage(ctx sdk.Context, addr ethcmn.Address, cb func(key, value ethcmn.Hash) bool) error
ForEachStorage calls CommitStateDB.ForEachStorage using passed in context
func (*Keeper) GetAccountStorage ¶
func (k *Keeper) GetAccountStorage(ctx sdk.Context, address common.Address) (evmtypes.Storage, error)
GetAccountStorage return state storage associated with an account
func (*Keeper) GetAllTxLogs ¶
func (k *Keeper) GetAllTxLogs(ctx sdk.Context) []evmtypes.TransactionLogs
GetAllTxLogs return all the transaction logs from the store.
func (*Keeper) GetBalance ¶
GetBalance calls CommitStateDB.GetBalance using the passed in context
func (*Keeper) GetBlockBloom ¶
GetBlockBloom gets bloombits from block height
func (*Keeper) GetBlockHash ¶
GetBlockHash gets block height from block consensus hash
func (*Keeper) GetChainConfig ¶
GetChainConfig gets block height from block consensus hash
func (*Keeper) GetCodeHash ¶
GetCodeHash calls CommitStateDB.GetCodeHash using the passed in context
func (Keeper) GetCodeInfo ¶
func (*Keeper) GetCodeSize ¶
GetCodeSize calls CommitStateDB.GetCodeSize using the passed in context
func (*Keeper) GetCommittedState ¶
func (k *Keeper) GetCommittedState(ctx sdk.Context, addr ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash
GetCommittedState calls CommitStateDB.GetCommittedState using the passed in context
func (Keeper) GetContractInfo ¶
func (k Keeper) GetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) *types.ContractInfo
func (Keeper) GetCreator ¶
func (k Keeper) GetCreator(ctx sdk.Context, contractAddress sdk.AccAddress) sdk.AccAddress
func (*Keeper) GetOrNewStateObject ¶
GetOrNewStateObject calls CommitStateDB.GetOrNetStateObject using the passed in context
func (*Keeper) GetSectionBloom ¶
func (*Keeper) HasSuicided ¶
HasSuicided calls CommitStateDB.HasSuicided using the passed in context
func (*Keeper) Instantiate ¶
func (k *Keeper) Instantiate(ctx sdk.Context, codeHash []byte, invoker sdk.AccAddress, args utils.WasmInput, name, version, author, email, describe string, genesisContractAddress sdk.AccAddress, gasWanted uint64) (sdk.AccAddress, error)
func (*Keeper) IntermediateRoot ¶
IntermediateRoot calls CommitStateDB.IntermediateRoot using the passed in context
func (*Keeper) Migrate ¶
func (k *Keeper) Migrate(ctx sdk.Context, codeHash []byte, invoker sdk.AccAddress, oldContract sdk.AccAddress, args utils.WasmInput, name, version, author, email, describe string, gasWanted uint64) (sdk.AccAddress, error)
func (Keeper) Query ¶
func (k Keeper) Query(ctx sdk.Context, contractAddress, invoker sdk.AccAddress, args utils.WasmInput) (types.ContractState, error)
queryContract
func (*Keeper) RecordSection ¶
func (*Keeper) RevertToSnapshot ¶
RevertToSnapshot calls CommitStateDB.RevertToSnapshot using the passed in context
func (*Keeper) SetBalance ¶
SetBalance calls CommitStateDB.SetBalance using the passed in context
func (*Keeper) SetBlockBloom ¶
SetBlockBloom sets the mapping from block height to bloom bits
func (*Keeper) SetBlockHash ¶
SetBlockHash sets the mapping from block consensus hash to block height
func (*Keeper) SetChainConfig ¶
func (k *Keeper) SetChainConfig(ctx sdk.Context, config evmtypes.ChainConfig)
SetChainConfig sets the mapping from block consensus hash to block height
func (Keeper) SetContractInfo ¶
func (k Keeper) SetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress, contract types.ContractInfo)
func (*Keeper) SetSectionBloom ¶
func (*Keeper) StorageTrie ¶
StorageTrie calls CommitStateDB.StorageTrie using the passed in context
func (*Keeper) SubBalance ¶
SubBalance calls CommitStateDB.SubBalance using the passed in context
func (*Keeper) UpdateAccounts ¶
UpdateAccounts calls CommitStateDB.UpdateAccounts using the passed in context
type QueryETHLogs ¶
QueryETHLogs is response type for tx logs query
type QueryResBlockNumber ¶
type QueryResBlockNumber struct {
Number int64 `json:"blockNumber"`
}
QueryResBlockNumber is response type for block number query
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
func (Sink) ReadString ¶
func (Sink) WriteAddress ¶
func (Sink) WriteBytes ¶
func (Sink) WriteString ¶
type SortMaps ¶
type SortMaps []SortMap
A slice of Pairs that implements sort.Interface to sort by Value.