Kagome
Polkadot Runtime Engine in C++17
host_api_impl.cpp
Go to the documentation of this file.
1 
7 
18 
19 namespace kagome::host_api {
20 
22  const OffchainExtensionConfig &offchain_config,
23  std::shared_ptr<const runtime::MemoryProvider> memory_provider,
24  std::shared_ptr<const runtime::CoreApiFactory> core_provider,
25  std::shared_ptr<runtime::TrieStorageProvider> storage_provider,
26  std::shared_ptr<const crypto::Sr25519Provider> sr25519_provider,
27  std::shared_ptr<const crypto::EcdsaProvider> ecdsa_provider,
28  std::shared_ptr<const crypto::Ed25519Provider> ed25519_provider,
29  std::shared_ptr<const crypto::Secp256k1Provider> secp256k1_provider,
30  std::shared_ptr<const crypto::Hasher> hasher,
31  std::shared_ptr<crypto::CryptoStore> crypto_store,
32  std::shared_ptr<const crypto::Bip39Provider> bip39_provider,
33  std::shared_ptr<offchain::OffchainPersistentStorage>
34  offchain_persistent_storage,
35  std::shared_ptr<offchain::OffchainWorkerPool> offchain_worker_pool)
36  : memory_provider_([&] {
37  BOOST_ASSERT(memory_provider);
38  return std::move(memory_provider);
39  }()),
40  storage_provider_([&] {
41  BOOST_ASSERT(storage_provider);
42  return std::move(storage_provider);
43  }()),
45  std::move(sr25519_provider),
46  std::move(ecdsa_provider),
47  std::move(ed25519_provider),
48  std::move(secp256k1_provider),
49  hasher,
50  std::move(crypto_store),
51  std::move(bip39_provider)),
55  hasher,
57  std::move(core_provider)},
60  offchain_ext_(offchain_config,
62  std::move(offchain_persistent_storage),
63  std::move(offchain_worker_pool)) {}
64 
67  }
68 
71  runtime::WasmSpan value_out,
72  runtime::WasmOffset offset) {
73  return storage_ext_.ext_storage_read_version_1(key, value_out, offset);
74  }
75 
77  runtime::WasmSpan key) const {
79  }
80 
82  runtime::WasmSpan key, runtime::WasmSpan value) const {
83  return storage_ext_.ext_storage_append_version_1(key, value);
84  }
85 
87  runtime::WasmSpan value) {
88  return storage_ext_.ext_storage_set_version_1(key, value);
89  }
90 
92  runtime::WasmSpan key) {
94  }
95 
98  }
99 
101  runtime::WasmSpan key_data) const {
103  }
104 
106  runtime::WasmSpan prefix) {
108  }
109 
111  runtime::WasmSpan prefix, runtime::WasmSpan limit) {
112  return storage_ext_.ext_storage_clear_prefix_version_2(prefix, limit);
113  }
114 
117  }
118 
120  runtime::WasmI32 state_version) {
121  return storage_ext_.ext_storage_root_version_2(state_version);
122  }
123 
125  runtime::WasmSpan parent_hash) {
127  }
128 
131  }
132 
135  }
136 
139  }
140 
142  runtime::WasmSpan values_data) {
144  }
145 
147  runtime::WasmSpan values_data) {
149  }
150 
152  runtime::WasmSpan values_data, runtime::WasmI32 state_version) {
154  values_data, state_version);
155  }
156 
157  // ------------------------Memory extensions v1-------------------------
159  runtime::WasmSize size) {
161  }
162 
165  }
166 
168  runtime::WasmSpan target,
169  runtime::WasmSpan message) {
170  io_ext_.ext_logging_log_version_1(level, target, message);
171  }
172 
175  }
176 
178 
181  }
182 
185  }
186 
188  runtime::WasmSize key_type) {
190  }
191 
193  runtime::WasmSize key_type, runtime::WasmSpan seed) {
194  return crypto_ext_.ext_crypto_ed25519_generate_version_1(key_type, seed);
195  }
196 
198  runtime::WasmSize key_type,
200  runtime::WasmSpan msg_data) {
202  key_type, key, msg_data);
203  }
204 
206  runtime::WasmPointer sig_data,
207  runtime::WasmSpan msg,
208  runtime::WasmPointer pubkey_data) {
210  sig_data, msg, pubkey_data);
211  }
212 
214  runtime::WasmSize key_type) {
216  }
217 
219  runtime::WasmSize key_type, runtime::WasmSpan seed) {
220  return crypto_ext_.ext_crypto_sr25519_generate_version_1(key_type, seed);
221  }
222 
224  runtime::WasmSize key_type,
226  runtime::WasmSpan msg_data) {
228  key_type, key, msg_data);
229  }
230 
232  runtime::WasmPointer sig_data,
233  runtime::WasmSpan msg,
234  runtime::WasmPointer pubkey_data) {
236  sig_data, msg, pubkey_data);
237  }
238 
240  runtime::WasmPointer sig_data,
241  runtime::WasmSpan msg,
242  runtime::WasmPointer pubkey_data) {
244  sig_data, msg, pubkey_data);
245  }
246 
248  runtime::WasmSize key_type) {
250  }
251 
253  runtime::WasmSize key_type,
255  runtime::WasmSpan msg_data) {
256  return crypto_ext_.ext_crypto_ecdsa_sign_version_1(key_type, key, msg_data);
257  }
258 
260  runtime::WasmSize key_type,
262  runtime::WasmSpan msg_data) {
264  key_type, key, msg_data);
265  }
266 
268  runtime::WasmSize key_type_id, runtime::WasmSpan seed) {
269  return crypto_ext_.ext_crypto_ecdsa_generate_version_1(key_type_id, seed);
270  }
271 
274  runtime::WasmSpan msg,
275  runtime::WasmPointer key) {
276  return crypto_ext_.ext_crypto_ecdsa_verify_version_1(sig, msg, key);
277  }
278 
281  runtime::WasmSpan msg,
282  runtime::WasmPointer key) {
284  sig, msg, key);
285  }
286 
287  // ------------------------- Hashing extension/crypto ---------------
288 
290  runtime::WasmSpan data) {
292  }
293 
295  runtime::WasmSpan data) {
297  }
298 
300  runtime::WasmSpan data) {
302  }
303 
305  runtime::WasmSpan data) {
307  }
308 
310  runtime::WasmSpan data) {
312  }
313 
315  runtime::WasmSpan data) {
317  }
318 
320  runtime::WasmSpan data) {
322  }
323 
325  runtime::WasmSpan data) const {
327  }
328 
331  }
332 
333  void HostApiImpl::ext_misc_print_num_version_1(uint64_t value) const {
335  }
336 
338  runtime::WasmSpan data) const {
340  }
341 
345  }
346 
350  }
351 
356  sig, msg);
357  }
358 
363  sig, msg);
364  }
365 
366  // --------------------------- Offchain extension ----------------------------
367 
370  }
371 
373  runtime::WasmSpan data) {
375  }
376 
379  }
380 
383  }
384 
386  runtime::WasmU64 deadline) {
388  }
389 
392  }
393 
397  kind, key, value);
398  }
399 
403  }
404 
407  runtime::WasmI32 kind,
408  runtime::WasmSpan key,
409  runtime::WasmSpan expected,
410  runtime::WasmSpan value) {
412  kind, key, expected, value);
413  }
414 
418  }
419 
423  method, uri, meta);
424  }
425 
427  runtime::WasmI32 request_id,
428  runtime::WasmSpan name,
429  runtime::WasmSpan value) {
431  request_id, name, value);
432  }
433 
435  runtime::WasmI32 request_id,
436  runtime::WasmSpan chunk,
437  runtime::WasmSpan deadline) {
439  request_id, chunk, deadline);
440  }
441 
443  runtime::WasmSpan ids, runtime::WasmSpan deadline) {
445  deadline);
446  }
447 
449  runtime::WasmI32 request_id) {
451  request_id);
452  }
453 
455  runtime::WasmI32 request_id,
456  runtime::WasmSpan buffer,
457  runtime::WasmSpan deadline) {
459  request_id, buffer, deadline);
460  }
461 
463  runtime::WasmSpan nodes, runtime::WasmI32 authorized_only) {
465  nodes, authorized_only);
466  }
467 
469  runtime::WasmSpan value) {
471  }
472 
475  }
476 
478  runtime::WasmSpan child_storage_key,
479  runtime::WasmSpan key,
480  runtime::WasmSpan value) {
482  child_storage_key, key, value);
483  }
484 
486  runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const {
488  child_storage_key, key);
489  }
490 
492  runtime::WasmSpan child_storage_key, runtime::WasmSpan key) {
494  child_storage_key, key);
495  }
496 
498  runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const {
500  child_storage_key, key);
501  }
502 
504  runtime::WasmSpan child_storage_key) const {
506  child_storage_key);
507  }
508 
510  runtime::WasmSpan child_storage_key, runtime::WasmSpan prefix) {
512  child_storage_key, prefix);
513  }
514 
516  runtime::WasmSpan child_storage_key,
517  runtime::WasmSpan key,
518  runtime::WasmSpan value_out,
519  runtime::WasmOffset offset) const {
521  child_storage_key, key, value_out, offset);
522  }
523 
525  runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const {
527  child_storage_key, key);
528  }
529 
531  runtime::WasmSpan child_storage_key) {
533  child_storage_key);
534  }
535 
536 } // namespace kagome::host_api
runtime::WasmSpan ext_offchain_http_response_read_body_version_1(runtime::WasmI32 request_id, runtime::WasmSpan buffer, runtime::WasmSpan deadline) override
uint64_t WasmU64
Definition: types.hpp:47
runtime::WasmSpan ext_misc_runtime_version_version_1(runtime::WasmSpan data) const
int32_t ext_crypto_ecdsa_verify_version_1(runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer key) const
runtime::WasmSpan ext_default_child_storage_get_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const
runtime::WasmSpan ext_storage_read_version_1(runtime::WasmSpan key, runtime::WasmSpan value_out, runtime::WasmOffset offset)
runtime::WasmSpan ext_crypto_ecdsa_sign_prehashed_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg_data) override
runtime::WasmSpan ext_crypto_sr25519_sign_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg_data) override
void ext_storage_append_version_1(runtime::WasmSpan key, runtime::WasmSpan value) const override
void ext_offchain_index_clear_version_1(runtime::WasmSpan key)
Remove a key and its associated value from the offchain database.
int32_t ext_crypto_sr25519_verify_version_2(runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer pubkey_data)
void ext_logging_log_version_1(runtime::WasmEnum level, runtime::WasmSpan target, runtime::WasmSpan message)
runtime::WasmSpan ext_default_child_storage_next_key_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const
runtime::WasmSpan ext_offchain_local_storage_get_version_1(runtime::WasmI32 kind, runtime::WasmSpan key)
Gets a value from the local storage.
runtime::WasmSpan ext_default_child_storage_root_version_1(runtime::WasmSpan child_storage_key) const override
Commits all existing operations and computes the resulting child storage root.
runtime::WasmSpan ext_offchain_http_response_wait_version_1(runtime::WasmSpan ids, runtime::WasmSpan deadline) override
Returns an array of request statuses (the length is the same as IDs). Note that if deadline is not pr...
runtime::WasmSpan ext_offchain_http_response_read_body_version_1(runtime::WasmI32 request_id, runtime::WasmSpan buffer, runtime::WasmSpan deadline)
Reads a chunk of body response to the given buffer. Returns the number of bytes written or an error i...
int32_t ext_crypto_ecdsa_verify_version_1(runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer key) override
Verifies an ecdsa signature. Returns true when the verification is either successful or batched...
void ext_storage_rollback_transaction_version_1() override
runtime::WasmPointer ext_crypto_ed25519_generate_version_1(runtime::WasmSize key_type, runtime::WasmSpan seed)
runtime::WasmPointer ext_hashing_twox_128_version_1(runtime::WasmSpan data) override
runtime::WasmU64 ext_offchain_timestamp_version_1()
Returns current timestamp.
runtime::WasmSpan ext_offchain_http_request_add_header_version_1(runtime::WasmI32 request_id, runtime::WasmSpan name, runtime::WasmSpan value) override
uint32_t WasmSize
Size type is uint32_t because we are working in 32 bit address space.
Definition: types.hpp:35
std::shared_ptr< runtime::TrieStorageProvider > storage_provider_
void ext_storage_append_version_1(runtime::WasmSpan key, runtime::WasmSpan value) const
runtime::WasmPointer ext_crypto_sr25519_generate_version_1(runtime::WasmSize key_type, runtime::WasmSpan seed)
runtime::WasmSpan ext_storage_root_version_1() override
Commits all existing operations and computes the resulting storage root.
runtime::WasmSpan ext_storage_next_key_version_1(runtime::WasmSpan key) const override
runtime::WasmSpan ext_offchain_local_storage_get_version_1(runtime::WasmI32 kind, runtime::WasmSpan key) override
Gets a value from the local storage.
runtime::WasmSpan ext_offchain_http_request_write_body_version_1(runtime::WasmI32 request_id, runtime::WasmSpan chunk, runtime::WasmSpan deadline) override
runtime::WasmSpan ext_default_child_storage_read_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key, runtime::WasmSpan value_out, runtime::WasmOffset offset) const
void ext_allocator_free_version_1(runtime::WasmPointer ptr)
runtime::WasmSpan ext_storage_changes_root_version_1(runtime::WasmSpan parent_hash) override
runtime::WasmSpan ext_crypto_secp256k1_ecdsa_recover_compressed_version_2(runtime::WasmPointer sig, runtime::WasmPointer msg) override
void ext_offchain_set_authorized_nodes_version_1(runtime::WasmSpan nodes, runtime::WasmI32 authorized_only) override
Set the authorized nodes which are allowed to connect to the local node. This function is offered by ...
runtime::WasmSpan ext_offchain_http_response_headers_version_1(runtime::WasmI32 request_id)
Read all HTTP response headers. Returns an array of key/value pairs. Response headers must be read be...
runtime::WasmSpan ext_offchain_http_response_headers_version_1(runtime::WasmI32 request_id) override
Read all HTTP response headers. Returns an array of key/value pairs. Response headers must be read be...
runtime::WasmSize ext_crypto_ed25519_verify_version_1(runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer pubkey_data)
virtual uint32_t ext_default_child_storage_exists_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const override
Checks whether the given key exists in the child storage.
runtime::WasmPointer ext_trie_blake2_256_ordered_root_version_1(runtime::WasmSpan values_data)
void ext_offchain_sleep_until_version_1(runtime::WasmU64 deadline) override
Pause the execution until deadline is reached.
int32_t ext_crypto_ecdsa_verify_prehashed_version_1(runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer key) const
void ext_storage_set_version_1(runtime::WasmSpan key, runtime::WasmSpan value) override
Sets the value under a given key into storage.
runtime::WasmPointer ext_hashing_blake2_128_version_1(runtime::WasmSpan data)
runtime::WasmPointer ext_trie_blake2_256_ordered_root_version_2(runtime::WasmSpan values_data, runtime::WasmI32 state_version) override
virtual void ext_default_child_storage_storage_kill_version_1(runtime::WasmSpan child_storage_key) override
Clears an entire child storage.
void ext_offchain_index_clear_version_1(runtime::WasmSpan key) override
Remove a key and its associated value from the offchain database.
void ext_offchain_index_set_version_1(runtime::WasmSpan key, runtime::WasmSpan value) override
Write a key value pair to the offchain database in a buffered fashion.
void ext_storage_clear_prefix_version_1(runtime::WasmSpan prefix)
uint32_t WasmOffset
Offset type is uint32_t because we are working in 32 bit address space.
Definition: types.hpp:44
int32_t WasmI32
Definition: types.hpp:46
runtime::WasmPointer ext_offchain_random_seed_version_1()
Generates a random seed. This is a truly random non deterministic seed generated by the host environm...
runtime::WasmPointer ext_hashing_sha2_256_version_1(runtime::WasmSpan data) override
runtime::WasmPointer ext_trie_blake2_256_root_version_1(runtime::WasmSpan values_data)
runtime::WasmSpan ext_storage_root_version_1()
runtime::WasmSpan ext_default_child_storage_next_key_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const override
Gets the next key in storage after the given one in lexicographic order. The key provided to this fun...
runtime::WasmSpan ext_crypto_secp256k1_ecdsa_recover_version_2(runtime::WasmPointer sig, runtime::WasmPointer msg) override
runtime::WasmSpan ext_crypto_ecdsa_public_keys_version_1(runtime::WasmSize key_type)
void ext_storage_clear_prefix_version_1(runtime::WasmSpan prefix) override
Clear the storage of each key/value pair where the key starts with the given prefix.
void ext_default_child_storage_storage_kill_version_1(runtime::WasmSpan child_storage_key)
runtime::WasmPointer ext_hashing_keccak_256_version_1(runtime::WasmSpan data) override
runtime::WasmSpan ext_offchain_http_response_wait_version_1(runtime::WasmSpan ids, runtime::WasmSpan deadline)
Returns an array of request statuses (the length is the same as IDs). Note that if deadline is not pr...
runtime::WasmSpan ext_crypto_secp256k1_ecdsa_recover_version_1(runtime::WasmPointer sig, runtime::WasmPointer msg)
std::shared_ptr< const runtime::MemoryProvider > memory_provider_
runtime::WasmPointer ext_crypto_ecdsa_generate_version_1(runtime::WasmSize key_type_id, runtime::WasmSpan seed) override
Generates an ecdsa key for the given key type using an optional BIP-39 seed and stores it in the keys...
runtime::WasmPointer ext_allocator_malloc_version_1(runtime::WasmSize size)
int32_t ext_crypto_ecdsa_verify_prehashed_version_1(runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer key) override
Verifies an ecdsa signature. Returns true when the verification is either successful or batched...
runtime::WasmPointer ext_hashing_keccak_256_version_1(runtime::WasmSpan data)
void ext_storage_commit_transaction_version_1() override
runtime::WasmSpan ext_default_child_storage_get_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const override
Retrieves the value associated with the given key from the child storage.
runtime::WasmPointer ext_hashing_twox_64_version_1(runtime::WasmSpan data)
virtual runtime::WasmSpan ext_default_child_storage_read_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key, runtime::WasmSpan value_out, runtime::WasmOffset offset) const override
Gets the given key from storage, placing the value into a buffer and returning the number of bytes th...
runtime::WasmSpan ext_storage_changes_root_version_1(runtime::WasmSpan parent_hash)
runtime::WasmSize ext_storage_exists_version_1(runtime::WasmSpan key_data) const
void ext_storage_clear_version_1(runtime::WasmSpan key_data)
runtime::WasmSpan ext_crypto_sr25519_sign_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg)
runtime::WasmPointer ext_crypto_ecdsa_generate_version_1(runtime::WasmSize key_type_id, runtime::WasmSpan seed) const
int32_t ext_crypto_sr25519_verify_version_1(runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer pubkey_data)
runtime::WasmI32 ext_offchain_local_storage_compare_and_set_version_1(runtime::WasmI32 kind, runtime::WasmSpan key, runtime::WasmSpan expected, runtime::WasmSpan value)
Sets a new value in the local storage if the condition matches the current value. ...
runtime::WasmPointer ext_offchain_random_seed_version_1() override
Generates a random seed. This is a truly random non deterministic seed generated by the host environm...
runtime::WasmSpan ext_offchain_http_request_start_version_1(runtime::WasmSpan method, runtime::WasmSpan uri, runtime::WasmSpan meta)
Initiates a HTTP request given by the HTTP method and the URL. Returns the id of a newly started requ...
runtime::WasmSize ext_crypto_ed25519_verify_version_1(runtime::WasmPointer sig_data, runtime::WasmSpan msg, runtime::WasmPointer pubkey_data) override
runtime::WasmPointer ext_trie_blake2_256_ordered_root_version_1(runtime::WasmSpan values_data) override
void ext_default_child_storage_set_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key, runtime::WasmSpan value)
runtime::WasmSpan ext_offchain_network_state_version_1()
Returns the SCALE encoded, opaque information about the local node&#39;s network state.
void ext_offchain_local_storage_clear_version_1(runtime::WasmI32 kind, runtime::WasmSpan key) override
Remove a value from the local storage.
runtime::WasmPointer ext_hashing_twox_128_version_1(runtime::WasmSpan data)
runtime::WasmSpan ext_crypto_sr25519_public_keys_version_1(runtime::WasmSize key_type) override
void ext_misc_print_utf8_version_1(runtime::WasmSpan data) const
runtime::WasmSpan ext_crypto_secp256k1_ecdsa_recover_compressed_version_1(runtime::WasmPointer sig, runtime::WasmPointer msg) override
runtime::WasmPointer ext_crypto_ed25519_generate_version_1(runtime::WasmSize key_type, runtime::WasmSpan seed) override
runtime::WasmSize ext_storage_exists_version_1(runtime::WasmSpan key_data) const override
Checks whether the given key exists in storage.
runtime::WasmSpan ext_crypto_ecdsa_public_keys_version_1(runtime::WasmSize key_type) override
runtime::WasmSpan ext_crypto_ed25519_sign_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg)
runtime::WasmSpan ext_storage_root_version_2(runtime::WasmI32 state_version) override
Commits all existing operations and computes the resulting storage root.
void ext_misc_print_utf8_version_1(runtime::WasmSpan data) const override
runtime::WasmSpan ext_storage_get_version_1(runtime::WasmSpan key)
runtime::WasmPointer ext_allocator_malloc_version_1(runtime::WasmSize size) override
runtime::WasmSpan ext_default_child_storage_root_version_1(runtime::WasmSpan child_storage_key) const
runtime::WasmI32 ext_offchain_local_storage_compare_and_set_version_1(runtime::WasmI32 kind, runtime::WasmSpan key, runtime::WasmSpan expected, runtime::WasmSpan value) override
void ext_offchain_local_storage_set_version_1(runtime::WasmI32 kind, runtime::WasmSpan key, runtime::WasmSpan value) override
Sets a value in the local storage. This storage is not part of the consensus, it&#39;s only accessible by...
runtime::WasmPointer ext_hashing_twox_64_version_1(runtime::WasmSpan data) override
void ext_offchain_set_authorized_nodes_version_1(runtime::WasmSpan nodes, runtime::WasmI32 authorized_only)
Set the authorized nodes which are allowed to connect to the local node. This function is offered by ...
runtime::WasmSize ext_crypto_finish_batch_verify_version_1()
runtime::WasmSpan ext_crypto_ecdsa_sign_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg_data) override
void ext_default_child_storage_clear_prefix_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan prefix) override
Clears the child storage of each key/value pair where the key starts with the given prefix...
runtime::WasmPointer ext_trie_blake2_256_ordered_root_version_2(runtime::WasmSpan values_data, runtime::WasmI32 state_version)
uint64_t WasmSpan
combination of pointer and size, where less significant part represents wasm pointer, and most significant represents size
Definition: types.hpp:31
runtime::WasmSpan ext_offchain_http_request_start_version_1(runtime::WasmSpan method, runtime::WasmSpan uri, runtime::WasmSpan meta) override
Initiates a HTTP request given by the HTTP method and the URL. Returns the id of a newly started requ...
uint32_t WasmEnum
Enum value is uint32_t.
Definition: types.hpp:39
runtime::WasmU64 ext_offchain_timestamp_version_1() override
Returns current timestamp.
runtime::WasmSpan ext_crypto_sr25519_public_keys_version_1(runtime::WasmSize key_type)
runtime::WasmSpan ext_storage_clear_prefix_version_2(runtime::WasmSpan prefix, runtime::WasmSpan limit)
runtime::WasmI32 ext_offchain_is_validator_version_1()
Check whether the local node is a potential validator. Even if this function returns 1...
runtime::WasmSpan ext_offchain_submit_transaction_version_1(runtime::WasmSpan data) override
Given a SCALE encoded extrinsic, this function submits the extrinsic to the Host&#39;s transaction pool...
runtime::WasmSpan ext_misc_runtime_version_version_1(runtime::WasmSpan data) const override
ChildStorageExtension child_storage_ext_
void ext_offchain_local_storage_set_version_1(runtime::WasmI32 kind, runtime::WasmSpan key, runtime::WasmSpan value)
Sets a value in the local storage. This storage is not part of the consensus, it&#39;s only accessible by...
runtime::WasmSpan ext_offchain_http_request_write_body_version_1(runtime::WasmI32 request_id, runtime::WasmSpan chunk, runtime::WasmSpan deadline)
Writes a chunk of the request body. Returns a non-zero value in case the deadline is reached or the c...
runtime::WasmEnum ext_logging_max_level_version_1()
runtime::WasmI32 ext_offchain_is_validator_version_1() override
Check whether the local node is a potential validator. Even if this function returns 1...
runtime::WasmSpan ext_offchain_http_request_add_header_version_1(runtime::WasmI32 request_id, runtime::WasmSpan name, runtime::WasmSpan value)
Append header to the request. Returns an error if the request identifier is invalid, http_response_wait has already been called on the specified request identifier, the deadline is reached or an I/O error has happened (e.g. the remote has closed the connection)
uint32_t ext_default_child_storage_exists_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key) const
runtime::WasmEnum ext_logging_max_level_version_1() override
void ext_default_child_storage_clear_prefix_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan prefix)
void ext_offchain_index_set_version_1(runtime::WasmSpan key, runtime::WasmSpan value)
Write a key value pair to the offchain database in a buffered fashion.
void ext_misc_print_num_version_1(uint64_t value) const override
void ext_default_child_storage_set_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key, runtime::WasmSpan value) override
Sets the value under a given key into the child storage.
uint32_t WasmPointer
type of wasm memory is 32 bit integer
Definition: types.hpp:26
void ext_offchain_sleep_until_version_1(runtime::WasmU64 deadline)
Pause the execution until deadline is reached.
runtime::WasmSpan ext_storage_get_version_1(runtime::WasmSpan key) override
Retrieves the value associated with the given key from storage.
void ext_offchain_local_storage_clear_version_1(runtime::WasmI32 kind, runtime::WasmSpan key)
Remove a value from the local storage.
runtime::WasmPointer ext_hashing_twox_256_version_1(runtime::WasmSpan data)
runtime::WasmSpan ext_crypto_ecdsa_sign_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg)
void ext_storage_start_transaction_version_1() override
void ext_storage_set_version_1(runtime::WasmSpan key, runtime::WasmSpan value)
void ext_default_child_storage_clear_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key) override
Clears the storage of the given key and its value from the child storage.
runtime::WasmSpan ext_crypto_secp256k1_ecdsa_recover_compressed_version_1(runtime::WasmPointer sig, runtime::WasmPointer msg)
runtime::WasmSpan ext_crypto_secp256k1_ecdsa_recover_version_1(runtime::WasmPointer sig, runtime::WasmPointer msg) override
int32_t ext_crypto_finish_batch_verify_version_1() override
Finish verifying the batch of signatures since the last call to this function. Blocks until all the s...
runtime::WasmSpan ext_crypto_ed25519_public_keys_version_1(runtime::WasmSize key_type)
runtime::WasmSpan ext_storage_root_version_2(runtime::WasmI32 state_version)
static constexpr uint64_t DEFAULT_CHAIN_ID
void ext_logging_log_version_1(runtime::WasmEnum level, runtime::WasmSpan target, runtime::WasmSpan message) override
void ext_misc_print_num_version_1(uint64_t value) const
runtime::WasmSpan ext_offchain_submit_transaction_version_1(runtime::WasmSpan data)
Given a SCALE encoded extrinsic, this function submits the extrinsic to the Host&#39;s transaction pool...
void ext_crypto_start_batch_verify_version_1() override
Crypto extensions v1.
runtime::WasmSpan ext_crypto_ed25519_public_keys_version_1(runtime::WasmSize key_type) override
runtime::WasmPointer ext_hashing_blake2_256_version_1(runtime::WasmSpan data)
runtime::WasmPointer ext_hashing_twox_256_version_1(runtime::WasmSpan data) override
void ext_storage_clear_version_1(runtime::WasmSpan key_data) override
Clears the storage of the given key and its value.
runtime::WasmPointer ext_trie_blake2_256_root_version_1(runtime::WasmSpan values_data) override
runtime::WasmSpan ext_crypto_ed25519_sign_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg_data) override
void ext_default_child_storage_clear_version_1(runtime::WasmSpan child_storage_key, runtime::WasmSpan key)
runtime::WasmSpan ext_offchain_network_state_version_1() override
Returns the SCALE encoded, opaque information about the local node&#39;s network state.
void ext_misc_print_hex_version_1(runtime::WasmSpan data) const override
runtime::WasmPointer ext_hashing_blake2_128_version_1(runtime::WasmSpan data) override
int32_t ext_crypto_sr25519_verify_version_1(runtime::WasmPointer sig_data, runtime::WasmSpan msg, runtime::WasmPointer pubkey_data) override
runtime::WasmPointer ext_crypto_sr25519_generate_version_1(runtime::WasmSize key_type, runtime::WasmSpan seed) override
runtime::WasmPointer ext_hashing_sha2_256_version_1(runtime::WasmSpan data)
void ext_allocator_free_version_1(runtime::WasmPointer ptr) override
runtime::WasmSpan ext_crypto_ecdsa_sign_prehashed_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg)
void ext_misc_print_hex_version_1(runtime::WasmSpan data) const
runtime::WasmSpan ext_storage_clear_prefix_version_2(runtime::WasmSpan prefix, runtime::WasmSpan limit) override
Clear the storage of each key/value pair where the key starts with the given prefix.
int32_t ext_crypto_sr25519_verify_version_2(runtime::WasmPointer, runtime::WasmSpan, runtime::WasmPointer) override
runtime::WasmSpan ext_storage_next_key_version_1(runtime::WasmSpan key) const
runtime::WasmPointer ext_hashing_blake2_256_version_1(runtime::WasmSpan data) override
runtime::WasmSpan ext_storage_read_version_1(runtime::WasmSpan key, runtime::WasmSpan value_out, runtime::WasmOffset offset) override
Reads data from storage with the given key.