6 #ifndef KAGOME_TRIE_CODEC_HPP 7 #define KAGOME_TRIE_CODEC_HPP 23 virtual ~Codec() =
default;
42 return outcome::success();
51 virtual outcome::result<std::shared_ptr<Node>>
decodeNode(
52 gsl::span<const uint8_t> encoded_data)
const = 0;
76 #endif // KAGOME_TRIE_CODEC_HPP Class represents arbitrary (including empty) byte buffer.
common::BufferView BufferView
virtual bool isMerkleHash(const common::BufferView &buf) const =0
is this a hash of value, or value itself
virtual outcome::result< common::Buffer > encodeNodeAndStoreChildren(const Node &node, const StoreChildren &store_children) const =0
Encode node to byte representation and store children.
outcome::result< common::Buffer > encodeNode(const Node &node) const
Encode node to byte representation.
virtual common::Buffer merkleValue(const common::BufferView &buf) const =0
Get the merkle value of a node.
virtual common::Hash256 hash256(const common::BufferView &buf) const =0
Get the hash of a node.
Internal codec for nodes in the Trie. Eth and substrate have different codecs, but rest of the code s...
virtual outcome::result< std::shared_ptr< Node > > decodeNode(gsl::span< const uint8_t > encoded_data) const =0
Decode node from bytes.
std::function< outcome::result< void >(common::BufferView, common::Buffer &&)> StoreChildren