Kagome
Polkadot Runtime Engine in C++17
|
#include <storage_extension.hpp>
Private Member Functions | |
outcome::result< std::optional< common::BufferConstRef > > | get (const common::BufferView &key) const |
common::Buffer | loadKey (runtime::WasmSpan key) const |
outcome::result< std::optional< common::Buffer > > | getStorageNextKey (const common::Buffer &key) const |
runtime::WasmSpan | clearPrefix (common::BufferView prefix, std::optional< uint32_t > limit) |
void | removeEmptyChildStorages () |
Private Attributes | |
std::shared_ptr< runtime::TrieStorageProvider > | storage_provider_ |
std::shared_ptr< const runtime::MemoryProvider > | memory_provider_ |
storage::trie::PolkadotCodec | codec_ |
log::Logger | logger_ |
Static Private Attributes | |
static constexpr auto | kDefaultLoggerTag = "WASM Runtime [StorageExtension]" |
Implements HostApi functions related to storage
Definition at line 24 of file storage_extension.hpp.
kagome::host_api::StorageExtension::StorageExtension | ( | std::shared_ptr< runtime::TrieStorageProvider > | storage_provider, |
std::shared_ptr< const runtime::MemoryProvider > | memory_provider | ||
) |
Definition at line 41 of file storage_extension.cpp.
|
private |
Definition at line 439 of file storage_extension.cpp.
void kagome::host_api::StorageExtension::ext_storage_append_version_1 | ( | runtime::WasmSpan | key, |
runtime::WasmSpan | value | ||
) | const |
Definition at line 286 of file storage_extension.cpp.
runtime::WasmSpan kagome::host_api::StorageExtension::ext_storage_changes_root_version_1 | ( | runtime::WasmSpan | parent_hash | ) |
Definition at line 250 of file storage_extension.cpp.
void kagome::host_api::StorageExtension::ext_storage_clear_prefix_version_1 | ( | runtime::WasmSpan | prefix | ) |
Definition at line 190 of file storage_extension.cpp.
runtime::WasmSpan kagome::host_api::StorageExtension::ext_storage_clear_prefix_version_2 | ( | runtime::WasmSpan | prefix, |
runtime::WasmSpan | limit | ||
) |
Definition at line 199 of file storage_extension.cpp.
void kagome::host_api::StorageExtension::ext_storage_clear_version_1 | ( | runtime::WasmSpan | key_data | ) |
Definition at line 163 of file storage_extension.cpp.
void kagome::host_api::StorageExtension::ext_storage_commit_transaction_version_1 | ( | ) |
Definition at line 326 of file storage_extension.cpp.
runtime::WasmSize kagome::host_api::StorageExtension::ext_storage_exists_version_1 | ( | runtime::WasmSpan | key_data | ) | const |
Definition at line 180 of file storage_extension.cpp.
runtime::WasmSpan kagome::host_api::StorageExtension::ext_storage_get_version_1 | ( | runtime::WasmSpan | key | ) |
Definition at line 140 of file storage_extension.cpp.
runtime::WasmSpan kagome::host_api::StorageExtension::ext_storage_next_key_version_1 | ( | runtime::WasmSpan | key | ) | const |
Definition at line 257 of file storage_extension.cpp.
runtime::WasmSpan kagome::host_api::StorageExtension::ext_storage_read_version_1 | ( | runtime::WasmSpan | key, |
runtime::WasmSpan | value_out, | ||
runtime::WasmOffset | offset | ||
) |
Definition at line 68 of file storage_extension.cpp.
void kagome::host_api::StorageExtension::ext_storage_rollback_transaction_version_1 | ( | ) |
Definition at line 336 of file storage_extension.cpp.
runtime::WasmSpan kagome::host_api::StorageExtension::ext_storage_root_version_1 | ( | ) |
Definition at line 224 of file storage_extension.cpp.
runtime::WasmSpan kagome::host_api::StorageExtension::ext_storage_root_version_2 | ( | runtime::WasmI32 | state_version | ) |
Definition at line 228 of file storage_extension.cpp.
void kagome::host_api::StorageExtension::ext_storage_set_version_1 | ( | runtime::WasmSpan | key, |
runtime::WasmSpan | value | ||
) |
Definition at line 121 of file storage_extension.cpp.
void kagome::host_api::StorageExtension::ext_storage_start_transaction_version_1 | ( | ) |
Definition at line 317 of file storage_extension.cpp.
runtime::WasmPointer kagome::host_api::StorageExtension::ext_trie_blake2_256_ordered_root_version_1 | ( | runtime::WasmSpan | values_data | ) |
Definition at line 405 of file storage_extension.cpp.
runtime::WasmPointer kagome::host_api::StorageExtension::ext_trie_blake2_256_ordered_root_version_2 | ( | runtime::WasmSpan | values_data, |
runtime::WasmI32 | state_version | ||
) |
Definition at line 412 of file storage_extension.cpp.
runtime::WasmPointer kagome::host_api::StorageExtension::ext_trie_blake2_256_root_version_1 | ( | runtime::WasmSpan | values_data | ) |
Definition at line 359 of file storage_extension.cpp.
|
private |
Find the value by given key and the return the part of it starting from given offset
key | Buffer representation of the key |
Definition at line 101 of file storage_extension.cpp.
|
private |
Definition at line 113 of file storage_extension.cpp.
|
private |
Read key in form of [ptr; size] and load its value from memory into buffer
key | representation by [ptr; size] |
Definition at line 107 of file storage_extension.cpp.
|
private |
Removes all empty child storages from the primary storage. Such cleanup is required for the correct storage root calculation.
Definition at line 462 of file storage_extension.cpp.
void kagome::host_api::StorageExtension::reset | ( | ) |
Definition at line 51 of file storage_extension.cpp.
|
private |
Definition at line 175 of file storage_extension.hpp.
|
staticprivate |
Definition at line 178 of file storage_extension.hpp.
|
private |
Definition at line 176 of file storage_extension.hpp.
|
private |
Definition at line 174 of file storage_extension.hpp.
|
private |
Definition at line 173 of file storage_extension.hpp.