sgns::storage::trie::TrieStorage¶
#include <trie_storage.hpp>
Inherits from IComponent
Inherited by sgns::storage::trie::TrieStorageImpl
Public Functions¶
| Name | |
|---|---|
| ~TrieStorage() override =default | |
| virtual outcome::result< std::unique_ptr< PersistentTrieBatch > > | getPersistentBatch() =0 |
| virtual outcome::result< std::unique_ptr< EphemeralTrieBatch > > | getEphemeralBatch() const =0 |
| virtual outcome::result< std::unique_ptr< PersistentTrieBatch > > | getPersistentBatchAt(const base::Hash256 & root) =0 |
| virtual outcome::result< std::unique_ptr< EphemeralTrieBatch > > | getEphemeralBatchAt(const base::Hash256 & root) const =0 |
| virtual base::Buffer | getRootHash() const =0 |
Additional inherited members¶
Public Functions inherited from IComponent
| Name | |
|---|---|
| virtual | ~IComponent() =default |
| virtual std::string | GetName() =0 |
Detailed Description¶
Grants access to the storage in two ways:
- persistent batch that will written back to the storage after commit() call
- ephemeral batch, all changes to which are left in memory and thus the main storage is never changed by it
Public Functions Documentation¶
function ~TrieStorage¶
function getPersistentBatch¶
Reimplemented by: sgns::storage::trie::TrieStorageImpl::getPersistentBatch
function getEphemeralBatch¶
Reimplemented by: sgns::storage::trie::TrieStorageImpl::getEphemeralBatch
function getPersistentBatchAt¶
virtual outcome::result< std::unique_ptr< PersistentTrieBatch > > getPersistentBatchAt(
const base::Hash256 & root
) =0
Warning: if the batch is committed, the trie will still switch to its state, creating a 'fork'
Reimplemented by: sgns::storage::trie::TrieStorageImpl::getPersistentBatchAt
Initializes a batch at the provided state
function getEphemeralBatchAt¶
virtual outcome::result< std::unique_ptr< EphemeralTrieBatch > > getEphemeralBatchAt(
const base::Hash256 & root
) const =0
Reimplemented by: sgns::storage::trie::TrieStorageImpl::getEphemeralBatchAt
function getRootHash¶
Reimplemented by: sgns::storage::trie::TrieStorageImpl::getRootHash
Root hash of the latest committed trie
Updated on 2026-03-04 at 13:10:44 -0800