Versions in this module Expand all Collapse all v1 v1.0.0 Sep 20, 2023 Changes in this version + var EmptyBinCodeHash = hex.DecodeString("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470") + var EmptyBinRootHash = hex.DecodeString("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") + var EmptyCodeHash = hex.DecodeString("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470") + var EmptyRootHash = hex.DecodeString("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") + func CompactedKeyToHex(compact []byte) []byte + type BinPatriciaHashed struct + func NewBinPatriciaHashed(accountKeyLen int, branchFn func(prefix []byte) ([]byte, error), ...) *BinPatriciaHashed + func (bph *BinPatriciaHashed) EncodeCurrentState(buf []byte) ([]byte, error) + func (bph *BinPatriciaHashed) ProcessUpdates(plainKeys, hashedKeys [][]byte, updates []Update) (rootHash []byte, branchNodeUpdates map[string]BranchData, err error) + func (bph *BinPatriciaHashed) Reset() + func (bph *BinPatriciaHashed) ResetFns(branchFn func(prefix []byte) ([]byte, error), ...) + func (bph *BinPatriciaHashed) ReviewKeys(plainKeys, hashedKeys [][]byte) (rootHash []byte, branchNodeUpdates map[string]BranchData, err error) + func (bph *BinPatriciaHashed) RootHash() ([]byte, error) + func (bph *BinPatriciaHashed) SetState(buf []byte) error + func (bph *BinPatriciaHashed) SetTrace(trace bool) + func (bph *BinPatriciaHashed) Variant() TrieVariant + type BinaryCell struct + Balance uint256.Int + CodeHash [length.Hash]byte + Delete bool + Nonce uint64 + Storage [length.Hash]byte + StorageLen int + type BranchData []byte + func EncodeBranch(bitmap, touchMap, afterMap uint16, ...) (branchData BranchData, lastNibble int, err error) + func (branchData BranchData) DecodeCells() (touchMap, afterMap uint16, row [16]*Cell, err error) + func (branchData BranchData) ExtractPlainKeys() (accountPlainKeys [][]byte, storagePlainKeys [][]byte, err error) + func (branchData BranchData) IsComplete() bool + func (branchData BranchData) MergeHexBranches(branchData2 BranchData, newData []byte) (BranchData, error) + func (branchData BranchData) ReplacePlainKeys(accountPlainKeys [][]byte, storagePlainKeys [][]byte, newData []byte) (BranchData, error) + func (branchData BranchData) String() string + type BranchMerger struct + func NewHexBranchMerger(capacity uint64) *BranchMerger + func (m *BranchMerger) Merge(branch1 BranchData, branch2 BranchData) (BranchData, error) + type Cell struct + Balance uint256.Int + CodeHash [length.Hash]byte + Delete bool + Nonce uint64 + Storage [length.Hash]byte + StorageLen int + type HexPatriciaHashed struct + func NewHexPatriciaHashed(accountKeyLen int, branchFn func(prefix []byte) ([]byte, error), ...) *HexPatriciaHashed + func (hph *HexPatriciaHashed) EncodeCurrentState(buf []byte) ([]byte, error) + func (hph *HexPatriciaHashed) ProcessUpdates(plainKeys, hashedKeys [][]byte, updates []Update) (rootHash []byte, branchNodeUpdates map[string]BranchData, err error) + func (hph *HexPatriciaHashed) Reset() + func (hph *HexPatriciaHashed) ResetFns(branchFn func(prefix []byte) ([]byte, error), ...) + func (hph *HexPatriciaHashed) ReviewKeys(plainKeys, hashedKeys [][]byte) (rootHash []byte, branchNodeUpdates map[string]BranchData, err error) + func (hph *HexPatriciaHashed) RootHash() ([]byte, error) + func (hph *HexPatriciaHashed) SetState(buf []byte) error + func (hph *HexPatriciaHashed) SetTrace(trace bool) + func (hph *HexPatriciaHashed) Variant() TrieVariant + type PartFlags uint8 + const AccountPlainPart + const HashPart + const HashedKeyPart + const StoragePlainPart + type Trie interface + ProcessUpdates func(pk, hk [][]byte, updates []Update) (rootHash []byte, branchNodeUpdates map[string]BranchData, err error) + Reset func() + ResetFns func(branchFn func(prefix []byte) ([]byte, error), ...) + ReviewKeys func(pk, hk [][]byte) (rootHash []byte, branchNodeUpdates map[string]BranchData, err error) + RootHash func() (hash []byte, err error) + SetTrace func(bool) + Variant func() TrieVariant + func InitializeTrie(tv TrieVariant) Trie + type TrieVariant string + const VariantBinPatriciaTrie + const VariantHexPatriciaTrie + func ParseTrieVariant(s string) TrieVariant + type Update struct + Balance uint256.Int + CodeHashOrStorage [length.Hash]byte + Flags UpdateFlags + Nonce uint64 + ValLength int + func (u *Update) Decode(buf []byte, pos int) (int, error) + func (u *Update) DecodeForStorage(enc []byte) + func (u *Update) Encode(buf []byte, numBuf []byte) []byte + func (u *Update) String() string + type UpdateFlags uint8 + const BalanceUpdate + const CodeUpdate + const DeleteUpdate + const NonceUpdate + const StorageUpdate + func (uf UpdateFlags) String() string