Skip to content

src/storage/trie/trie_storage.hpp

Namespaces

Name
sgns
sgns::storage
sgns::storage::trie

Classes

Name
class sgns::storage::trie::TrieStorage

Source code

#ifndef SUPERGENIUS_STORAGE_TRIE_TRIE_STORAGE
#define SUPERGENIUS_STORAGE_TRIE_TRIE_STORAGE

#include "base/blob.hpp"
#include "storage/trie/trie_batches.hpp"
#include "singleton/IComponent.hpp"

namespace sgns::storage::trie {

  class TrieStorage : public IComponent {
   public:
       ~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;
  };

}  // namespace sgns::storage::trie

#endif  // SUPERGENIUS_STORAGE_TRIE_TRIE_STORAGE

Updated on 2026-03-04 at 13:10:45 -0800