6 #ifndef KAGOME_CORE_RUNTIME_COMMON_TRIE_STORAGE_PROVIDER_IMPL 7 #define KAGOME_CORE_RUNTIME_COMMON_TRIE_STORAGE_PROVIDER_IMPL 12 #include <unordered_map> 29 std::shared_ptr<storage::trie::TrieStorage> trie_storage,
30 std::shared_ptr<storage::trie::TrieSerializer> trie_serializer);
48 outcome::result<storage::trie::RootHash>
forceCommit()
override;
68 std::unordered_map<common::Buffer, std::shared_ptr<PersistentBatch>>
78 #endif // KAGOME_CORE_RUNTIME_COMMON_TRIE_STORAGE_PROVIDER_IMPL Class represents arbitrary (including empty) byte buffer.
outcome::result< void > commitTransaction() override
Commit and finish last started transaction.
~TrieStorageProviderImpl() override=default
std::shared_ptr< PersistentBatch > persistent_batch_
outcome::result< void > startTransaction() override
Start nested transaction.
outcome::result< std::shared_ptr< PersistentBatch > > getChildBatchAt(const common::Buffer &root_path) override
Get (or create new) Child Batch with given root hash.
OUTCOME_HPP_DECLARE_ERROR(kagome::runtime, TrieStorageProviderImpl::Error)
outcome::result< void > setToPersistentAt(const common::Hash256 &state_root) override
outcome::result< void > setToEphemeralAt(const common::Hash256 &state_root) override
std::shared_ptr< storage::trie::TrieSerializer > trie_serializer_
bool isCurrentlyPersistent() const override
std::shared_ptr< soralog::Logger > Logger
std::shared_ptr< storage::trie::TrieStorage > trie_storage_
void clearChildBatches() noexceptoverride
std::unordered_map< common::Buffer, std::shared_ptr< PersistentBatch > > child_batches_
std::stack< std::shared_ptr< Batch > > stack_of_batches_
std::shared_ptr< Batch > getCurrentBatch() const override
outcome::result< void > rollbackTransaction() override
Rollback and finish last started transaction.
std::optional< std::shared_ptr< PersistentBatch > > tryGetPersistentBatch() const override
std::shared_ptr< Batch > current_batch_
TrieStorageProviderImpl(std::shared_ptr< storage::trie::TrieStorage > trie_storage, std::shared_ptr< storage::trie::TrieSerializer > trie_serializer)
outcome::result< storage::trie::RootHash > forceCommit() override