laconicd/x/evm/types/key.go
Federico Kunze 792c1ff756
evm: params (#458)
* evm: params

* setup

* bump commit

* fixes

* increase gas usage

* tests

* evm denom param

* more config updates

* update genesis

* update ante handler

* csdb param test

* more tests and fixes

* update statedb.Copy

* lint

* additional test

* fix importer tests

* fix AnteHandler test

* minor update

* revert

* undo gas update

* stringer test

* changelog

* fix csdb index error (#493)

* attempt to fix

* cleanup

* add idx check

* update csdb.Copy

* update default hash

* update querier

* update rpc tests

* fix estimate gas test

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
Co-authored-by: noot <elizabethjbinks@gmail.com>
2020-09-02 15:41:05 -04:00

41 lines
1017 B
Go

package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
ethcmn "github.com/ethereum/go-ethereum/common"
)
const (
// ModuleName string name of module
ModuleName = "evm"
// StoreKey key for ethereum storage data, account code (StateDB) or block
// related data for Web3.
// The EVM module should use a prefix store.
StoreKey = ModuleName
// RouterKey uses module name for routing
RouterKey = ModuleName
)
// KVStore key prefixes
var (
KeyPrefixBlockHash = []byte{0x01}
KeyPrefixBloom = []byte{0x02}
KeyPrefixLogs = []byte{0x03}
KeyPrefixCode = []byte{0x04}
KeyPrefixStorage = []byte{0x05}
KeyPrefixChainConfig = []byte{0x06}
)
// BloomKey defines the store key for a block Bloom
func BloomKey(height int64) []byte {
return sdk.Uint64ToBigEndian(uint64(height))
}
// AddressStoragePrefix returns a prefix to iterate over a given account storage.
func AddressStoragePrefix(address ethcmn.Address) []byte {
return append(KeyPrefixStorage, address.Bytes()...)
}