runtime-api: sync syscall function signatures with pallet (#397)

This PR synchronizes the syscall function signatures in the runtime-api
with the current revive pallet API surface.

Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
xermicus
2025-10-30 14:43:55 +01:00
committed by GitHub
parent 84018c18ae
commit df1921ba93
3 changed files with 10 additions and 15 deletions
+2 -2
View File
@@ -99,7 +99,7 @@ pub fn call<'ctx>(
let is_success = context.builder().build_int_compare(
inkwell::IntPredicate::EQ,
success,
context.integer_const(revive_common::BIT_LENGTH_X64, 0),
context.integer_const(revive_common::BIT_LENGTH_X32, 0),
"is_success",
)?;
@@ -178,7 +178,7 @@ pub fn delegate_call<'ctx>(
let is_success = context.builder().build_int_compare(
inkwell::IntPredicate::EQ,
success,
context.integer_const(revive_common::BIT_LENGTH_X64, 0),
context.integer_const(revive_common::BIT_LENGTH_X32, 0),
"is_success",
)?;
+7 -9
View File
@@ -53,11 +53,11 @@ POLKAVM_IMPORT(void, block_hash, uint32_t, uint32_t)
POLKAVM_IMPORT(void, block_number, uint32_t)
POLKAVM_IMPORT(uint64_t, call, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
POLKAVM_IMPORT(uint32_t, call, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
POLKAVM_IMPORT(uint64_t, call_data_copy, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(void, call_data_copy, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(uint64_t, call_data_load, uint32_t, uint32_t)
POLKAVM_IMPORT(void, call_data_load, uint32_t, uint32_t)
POLKAVM_IMPORT(uint64_t, call_data_size)
@@ -69,7 +69,7 @@ POLKAVM_IMPORT(uint64_t, code_size, uint32_t)
POLKAVM_IMPORT(void, code_hash, uint32_t, uint32_t)
POLKAVM_IMPORT(uint64_t, delegate_call, uint64_t, uint64_t, uint64_t, uint32_t, uint64_t, uint64_t)
POLKAVM_IMPORT(uint32_t, delegate_call, uint64_t, uint64_t, uint64_t, uint32_t, uint64_t, uint64_t)
POLKAVM_IMPORT(void, deposit_event, uint32_t, uint32_t, uint32_t, uint32_t)
@@ -79,11 +79,11 @@ POLKAVM_IMPORT(uint64_t, gas_price);
POLKAVM_IMPORT(void, get_immutable_data, uint32_t, uint32_t);
POLKAVM_IMPORT(uint64_t, get_storage_or_zero, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(void, get_storage_or_zero, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(void, hash_keccak_256, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(uint64_t, instantiate, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
POLKAVM_IMPORT(uint32_t, instantiate, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
POLKAVM_IMPORT(void, now, uint32_t)
@@ -99,8 +99,6 @@ POLKAVM_IMPORT(uint64_t, return_data_size)
POLKAVM_IMPORT(void, set_immutable_data, uint32_t, uint32_t);
POLKAVM_IMPORT(uint64_t, set_storage_or_clear, uint32_t, uint32_t, uint32_t)
POLKAVM_IMPORT(uint32_t, set_storage_or_clear, 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);
+1 -4
View File
@@ -66,11 +66,9 @@ pub static SET_STORAGE: &str = "set_storage_or_clear";
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; 33] = [
pub static IMPORTS: [&str; 32] = [
ADDRESS,
BALANCE,
BALANCE_OF,
@@ -103,7 +101,6 @@ pub static IMPORTS: [&str; 33] = [
SET_IMMUTABLE_DATA,
SET_STORAGE,
VALUE_TRANSFERRED,
WEIGHT_TO_FEE,
];
/// Creates a LLVM module from the [BITCODE].