Forge v0.7.2 Forge.Mpt View Source
Encapsulate the Merkle Patricia Tree implementation to make it more robust for our use cases
Link to this section Summary
Functions
Retrieve a k from the trie
Retrieve the app_hash from last block of the trie. Usually used in application start
Retrieve the app_hash from the given block of the trie
Retrieve the last_block and the app_hash of the trie
Retrieve the latest block height. Return 0 if none
Open a database for write/read
Put a key and a value to the trie. This will lead to a change of root_hash
Update the block hash to the block height and update the last block to current height
Link to this section Types
Link to this section Functions
get(MerklePatriciaTree.Trie.t(), MerklePatriciaTree.Trie.key()) :: binary() | nil
Retrieve a k from the trie.
get_app_hash(MerklePatriciaTree.Trie.t() | nil) :: binary() | nil
Retrieve the app_hash from last block of the trie. Usually used in application start.
get_app_hash(MerklePatriciaTree.Trie.t() | nil, non_neg_integer()) :: binary() | nil
Retrieve the app_hash from the given block of the trie.
Retrieve the last_block and the app_hash of the trie
get_last_block(MerklePatriciaTree.Trie.t()) :: non_neg_integer()
Retrieve the latest block height. Return 0 if none.
Open a database for write/read
put(MerklePatriciaTree.Trie.t(), MerklePatriciaTree.Trie.key(), binary()) :: MerklePatriciaTree.Trie.t()
Put a key and a value to the trie. This will lead to a change of root_hash.
update_block(MerklePatriciaTree.Trie.t(), non_neg_integer()) :: MerklePatriciaTree.Trie.t()
Update the block hash to the block height and update the last block to current height