sgns::runtime::TrieStorageProvider¶
#include <trie_storage_provider.hpp>
Inherited by sgns::runtime::TrieStorageProviderImpl
Public Types¶
| Name | |
|---|---|
| using storage::trie::TrieBatch | Batch |
| using storage::trie::PersistentTrieBatch | PersistentBatch |
Public Functions¶
| Name | |
|---|---|
| virtual | ~TrieStorageProvider() =default |
| virtual outcome::result< void > | setToEphemeral() =0 |
| virtual outcome::result< void > | setToEphemeralAt(const base::Hash256 & state_root) =0 |
| virtual outcome::result< void > | setToPersistent() =0 |
| virtual outcome::result< void > | setToPersistentAt(const base::Hash256 & state_root) =0 |
| virtual std::shared_ptr< Batch > | getCurrentBatch() const =0 |
| virtual boost::optional< std::shared_ptr< PersistentBatch > > | tryGetPersistentBatch() const =0 |
| virtual bool | isCurrentlyPersistent() const =0 |
| virtual outcome::result< base::Buffer > | forceCommit() =0 |
Detailed Description¶
Provides access to the trie storage for runtime API As some calls need an access to a temporary storage (called 'ephemeral') and some introduce changes that need to persist, TrieStorageProvider maintains a 'current batch', which can be either persistent or ephemeral, and provides it for runtime calls
Public Types Documentation¶
using Batch¶
using PersistentBatch¶
Public Functions Documentation¶
function ~TrieStorageProvider¶
function setToEphemeral¶
Reimplemented by: sgns::runtime::TrieStorageProviderImpl::setToEphemeral
Sets the current batch to a new ephemeral batch
function setToEphemeralAt¶
Reimplemented by: sgns::runtime::TrieStorageProviderImpl::setToEphemeralAt
function setToPersistent¶
Reimplemented by: sgns::runtime::TrieStorageProviderImpl::setToPersistent
Sets the current batch to the persistent batch (a persistent batch is unique as it accumulates changes for commit)
function setToPersistentAt¶
Warning: this will reset storage state to th specified root and discard all changes accumulated in the current persistent batch
Reimplemented by: sgns::runtime::TrieStorageProviderImpl::setToPersistentAt
Sets the current batch to a new persistent batch at specified storage state
function getCurrentBatch¶
See: setToEphemeral, setToPersistent), null otherwise
Return: current batch, if any was set (
Reimplemented by: sgns::runtime::TrieStorageProviderImpl::getCurrentBatch
function tryGetPersistentBatch¶
Return: current persistent batch, if the current batch is persistent, none otherwise
Reimplemented by: sgns::runtime::TrieStorageProviderImpl::tryGetPersistentBatch
function isCurrentlyPersistent¶
Return: true, if the current batch is persistent, false otherwise
Reimplemented by: sgns::runtime::TrieStorageProviderImpl::isCurrentlyPersistent
function forceCommit¶
Reimplemented by: sgns::runtime::TrieStorageProviderImpl::forceCommit
Commits persistent changes even if the current batch is not persistent
Updated on 2026-03-04 at 13:10:43 -0800