implement the gas opcode (#136)

This commit is contained in:
Cyrill Leutwiler
2024-12-18 17:19:32 +01:00
committed by GitHub
parent 55ec0988e8
commit 14a598e840
8 changed files with 417 additions and 373 deletions
+3 -1
View File
@@ -108,7 +108,7 @@ POLKAVM_IMPORT(void, origin, uint32_t)
POLKAVM_IMPORT(void, seal_return, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(uint64_t, set_storage, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(uint64_t, ref_time_left)
POLKAVM_IMPORT(void, return_data_copy, uint32_t, uint32_t, uint32_t)
@@ -116,6 +116,8 @@ POLKAVM_IMPORT(void, return_data_size, uint32_t)
POLKAVM_IMPORT(void, set_immutable_data, uint32_t, uint32_t);
POLKAVM_IMPORT(uint64_t, set_storage, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(void, value_transferred, uint32_t)
POLKAVM_IMPORT(void, weight_to_fee, uint64_t, uint64_t, uint32_t);
+6 -3
View File
@@ -56,9 +56,9 @@ pub static NOW: &str = "now";
pub static ORIGIN: &str = "origin";
pub static RETURN: &str = "seal_return";
pub static REF_TIME_LEFT: &str = "ref_time_left";
pub static SET_STORAGE: &str = "set_storage";
pub static RETURN: &str = "seal_return";
pub static RETURNDATACOPY: &str = "return_data_copy";
@@ -66,13 +66,15 @@ pub static RETURNDATASIZE: &str = "return_data_size";
pub static SET_IMMUTABLE_DATA: &str = "set_immutable_data";
pub static SET_STORAGE: &str = "set_storage";
pub static VALUE_TRANSFERRED: &str = "value_transferred";
pub static WEIGHT_TO_FEE: &str = "weight_to_fee";
/// All imported runtime API symbols.
/// Useful for configuring common attributes and linkage.
pub static IMPORTS: [&str; 30] = [
pub static IMPORTS: [&str; 31] = [
SBRK,
MEMORY_SIZE,
ADDRESS,
@@ -96,6 +98,7 @@ pub static IMPORTS: [&str; 30] = [
INSTANTIATE,
NOW,
ORIGIN,
REF_TIME_LEFT,
RETURN,
RETURNDATACOPY,
RETURNDATASIZE,