Kagome
Polkadot Runtime Engine in C++17
trie_serializer.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_STORAGE_POLKADOT_TRIE_SERIALIZER
7 #define KAGOME_STORAGE_POLKADOT_TRIE_SERIALIZER
8 
9 #include "outcome/outcome.hpp"
11 #include "storage/trie/types.hpp"
12 
13 namespace kagome::storage::trie {
14 
19  public:
20  virtual ~TrieSerializer() = default;
21 
25  virtual RootHash getEmptyRootHash() const = 0;
26 
31  virtual outcome::result<RootHash> storeTrie(PolkadotTrie &trie) = 0;
32 
37  virtual outcome::result<std::shared_ptr<PolkadotTrie>> retrieveTrie(
38  const common::Buffer &db_key) const = 0;
39  };
40 
41 } // namespace kagome::storage::trie
42 
43 #endif // KAGOME_STORAGE_POLKADOT_TRIE_SERIALIZER
Class represents arbitrary (including empty) byte buffer.
Definition: buffer.hpp:29
virtual outcome::result< RootHash > storeTrie(PolkadotTrie &trie)=0
virtual RootHash getEmptyRootHash() const =0
virtual outcome::result< std::shared_ptr< PolkadotTrie > > retrieveTrie(const common::Buffer &db_key) const =0