Forge v0.5.3 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

Retrieve a k from the trie.

Link to this function get_app_hash(trie) View Source
get_app_hash(MerklePatriciaTree.Trie.t() | nil) :: binary() | nil

Retrieve the app_hash from last block of the trie. Usually used in application start.

Link to this function get_app_hash(arg1, block) View Source
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

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