#include <polkadot_codec.hpp>
Definition at line 19 of file polkadot_codec.hpp.
Enumerator |
---|
SUCCESS |
|
TOO_MANY_NIBBLES |
number of nibbles in key is >= 2**16
|
UNKNOWN_NODE_TYPE |
node type is unknown
|
INPUT_TOO_SMALL |
cannot decode a node, not enough bytes on input
|
NO_NODE_VALUE |
leaf node without value
|
Definition at line 24 of file polkadot_codec.hpp.
kagome::storage::trie::PolkadotCodec::~PolkadotCodec |
( |
| ) |
|
|
overridedefault |
outcome::result< std::pair< TrieNode::Type, size_t > > kagome::storage::trie::PolkadotCodec::decodeHeader |
( |
BufferStream & |
stream | ) |
const |
|
private |
outcome::result< std::shared_ptr< Node > > kagome::storage::trie::PolkadotCodec::decodeNode |
( |
gsl::span< const uint8_t > |
encoded_data | ) |
const |
|
overridevirtual |
outcome::result< KeyNibbles > kagome::storage::trie::PolkadotCodec::decodePartialKey |
( |
size_t |
nibbles_num, |
|
|
BufferStream & |
stream |
|
) |
| const |
|
private |
outcome::result< common::Buffer > kagome::storage::trie::PolkadotCodec::encodeHeader |
( |
const TrieNode & |
node | ) |
const |
Encodes a node header according to the specification
- See also
- Algorithm 3: partial key length encoding
Definition at line 103 of file polkadot_codec.cpp.
outcome::result< common::Buffer > kagome::storage::trie::PolkadotCodec::encodeLeaf |
( |
const LeafNode & |
node | ) |
const |
|
private |
outcome::result< common::Buffer > kagome::storage::trie::PolkadotCodec::encodeNodeAndStoreChildren |
( |
const Node & |
node, |
|
|
const StoreChildren & |
store_children |
|
) |
| const |
|
overridevirtual |
Encode node to byte representation and store children.
- Parameters
-
node | node in the trie |
store_children | chidren storer |
- Returns
- encoded representation of a {
- Parameters
-
Implements kagome::storage::trie::Codec.
Definition at line 70 of file polkadot_codec.cpp.
bool kagome::storage::trie::PolkadotCodec::isMerkleHash |
( |
const common::BufferView & |
buf | ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following files: