Documentation ¶
Index ¶
- func GetAccountStorageKey(addr common.Address, version uint64) string
- func MarshalAccountValue(v AccountValue, bs []byte) (n int)
- func MarshalAddress(v common.Address, bs []byte) (n int)
- func MarshalBytes(v []byte, bs []byte) (n int)
- func MarshalHash(v common.Hash, bs []byte) (n int)
- func MarshalLayerLog(v LayerLog, bs []byte) (n int)
- func MarshalStorage(v map[common.Hash]common.Hash, bs []byte) (n int)
- func MarshalUint256(v *uint256.Int, bs []byte) (n int)
- func SizeAccountValue(v AccountValue) (size int)
- func SizeAddress(v common.Address) (size int)
- func SizeBytes(v []byte) (size int)
- func SizeHash(v common.Hash) (size int)
- func SizeLayerLog(v LayerLog) (size int)
- func SizeStorage(v map[common.Hash]common.Hash) (size int)
- func SizeUint256(v *uint256.Int) (size int)
- func SplitAccountStorageKey(key string) (common.Address, uint64)
- func UnmarshalAddress(bs []byte) (v common.Address, n int, err error)
- func UnmarshalBytes(bs []byte) (v []byte, n int, err error)
- func UnmarshalHash(bs []byte) (v common.Hash, n int, err error)
- func UnmarshalStorage(bs []byte) (v map[common.Hash]common.Hash, n int, err error)
- func UnmarshalUint256(bs []byte) (v *uint256.Int, n int, err error)
- type AccountValue
- type LayerLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccountStorageKey ¶
GetAccountStorageKey gets the storage key for a given address and version.
func MarshalAccountValue ¶
func MarshalAccountValue(v AccountValue, bs []byte) (n int)
MarshalAccountValue implements the mus.Marshaller interface.
func MarshalAddress ¶
MarshalAddress implements the mus.Marshaller interface.
func MarshalBytes ¶
MarshalBytes implements the mus.Marshaller interface.
func MarshalHash ¶
MarshalHash implements the mus.Marshaller interface.
func MarshalLayerLog ¶
MarshalLayerLog implements the mus.Marshaller interface.
func MarshalStorage ¶
MarshalStorage implements the mus.Marshaller interface.
func MarshalUint256 ¶
MarshalUint256 implements the mus.Marshaller interface.
func SizeAccountValue ¶
func SizeAccountValue(v AccountValue) (size int)
SizeAccountValue implements the mus.Sizer interface.
func SizeAddress ¶
SizeAddress implements the mus.Sizer interface.
func SizeLayerLog ¶
SizeLayerLog implements the mus.Sizer interface.
func SizeStorage ¶
SizeStorage implements the mus.Sizer interface.
func SizeUint256 ¶
SizeUint256 implements the mus.Sizer interface.
func SplitAccountStorageKey ¶
SplitAccountStorageKey splits the storage key to get the address and version. This is unsafe, must be called on valid key string.
func UnmarshalAddress ¶
UnmarshalAddress implements the mus.Unmarshaller interface.
func UnmarshalBytes ¶
UnmarshalBytes implements the mus.Unmarshaller interface.
func UnmarshalHash ¶
UnmarshalHash implements the mus.Unmarshaller interface.
func UnmarshalStorage ¶
UnmarshalStorage implements the mus.Unmarshaller interface.
Types ¶
type AccountValue ¶
type AccountValue struct { // The nonce of the account Nonce uint64 // The balance of the account Balance *uint256.Int // The code hash of this account CodeHash common.Hash // Flag indicating if this account's storage trie is empty DirtyStorage bool // Version of the account Version uint64 }
AccountValue is used to represent the state of an account.
func UnmarshalAccountValue ¶
func UnmarshalAccountValue(bs []byte) (v AccountValue, n int, err error)
UnmarshalAccountValue implements the mus.Unmarshaller interface.
type LayerLog ¶
type LayerLog struct { // Block number of this layer BlockNumber uint64 // Root hash of this layer RootHash common.Hash // Updated accounts in this layer // A map from addr -> acct value UpdatedAccounts map[common.Address]AccountValue // Updated code (added/deleted) count in this layer // A map from codeHash -> change in count. UpdatedCodeCount map[common.Hash]int64 // Seen code in this layer // A map from codeHash -> code CodePreimage map[common.Hash][]byte // Updated storage in this layer // A map from "addr.Hex()-version" -> key -> value UpdatedStorage map[string]map[common.Hash]common.Hash }
LayerLog is used to represent the state existed in a state layer.
func LayerLogFromGenesis ¶
Creates layerlog for the genesis block.