6 #ifndef KAGOME_TRIE_POLKADOT_CODEC_IMPL_HPP 7 #define KAGOME_TRIE_POLKADOT_CODEC_IMPL_HPP 37 outcome::result<std::shared_ptr<Node>>
decodeNode(
38 gsl::span<const uint8_t> encoded_data)
const override;
57 outcome::result<std::pair<TrieNode::Type, size_t>>
decodeHeader(
73 #endif // KAGOME_TRIE_POLKADOT_CODEC_IMPL_HPP
~PolkadotCodec() override=default
Class represents arbitrary (including empty) byte buffer.
common::Buffer merkleValue(const BufferView &buf) const override
Get the merkle value of a node.
outcome::result< Buffer > encodeHeader(const TrieNode &node) const
common::BufferView BufferView
outcome::result< Buffer > encodeLeaf(const LeafNode &node) const
number of nibbles in key is >= 2**16
outcome::result< Buffer > encodeBranch(const BranchNode &node, const StoreChildren &store_children) const
outcome::result< std::pair< TrieNode::Type, size_t > > decodeHeader(BufferStream &stream) const
outcome::result< KeyNibbles > decodePartialKey(size_t nibbles_num, BufferStream &stream) const
SLBuffer< std::numeric_limits< size_t >::max()> Buffer
bool isMerkleHash(const common::BufferView &buf) const override
is this a hash of value, or value itself
common::Hash256 hash256(const BufferView &buf) const override
Get the hash of a node.
outcome::result< std::shared_ptr< Node > > decodeBranch(TrieNode::Type type, const KeyNibbles &partial_key, BufferStream &stream) const
cannot decode a node, not enough bytes on input
outcome::result< Buffer > encodeNodeAndStoreChildren(const Node &node, const StoreChildren &store_children) const override
Encode node to byte representation and store children.
outcome::result< std::shared_ptr< Node > > decodeNode(gsl::span< const uint8_t > encoded_data) const override
Decode node from bytes.
OUTCOME_HPP_DECLARE_ERROR(kagome::storage::trie, PolkadotCodec::Error)
Internal codec for nodes in the Trie. Eth and substrate have different codecs, but rest of the code s...
std::function< outcome::result< void >(common::BufferView, common::Buffer &&)> StoreChildren