mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-18 03:31:03 +00:00
tidy up the runtime API crate (#85)
- remove unused runtime API imports and constants - move runtime api symbols into the revive-runtime-api crate Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -4,7 +4,6 @@ use inkwell::values::BasicValue;
|
||||
|
||||
use crate::polkavm::context::Context;
|
||||
use crate::polkavm::Dependency;
|
||||
use crate::polkavm_const::runtime_api;
|
||||
|
||||
/// Translates the `gas` instruction.
|
||||
pub fn gas<'ctx, D>(
|
||||
@@ -26,7 +25,7 @@ where
|
||||
let output_pointer = context.build_alloca(context.value_type(), "value_transferred");
|
||||
context.build_store(output_pointer, context.word_const(0))?;
|
||||
context.build_runtime_call(
|
||||
runtime_api::imports::VALUE_TRANSFERRED,
|
||||
revive_runtime_api::polkavm_imports::VALUE_TRANSFERRED,
|
||||
&[output_pointer.to_int(context).into()],
|
||||
);
|
||||
context.build_load(output_pointer, "value_transferred")
|
||||
@@ -50,7 +49,7 @@ where
|
||||
)?;
|
||||
|
||||
context.build_runtime_call(
|
||||
runtime_api::imports::BALANCE_OF,
|
||||
revive_runtime_api::polkavm_imports::BALANCE_OF,
|
||||
&[address_pointer.to_int(context).into(), balance.into()],
|
||||
);
|
||||
|
||||
@@ -71,7 +70,10 @@ where
|
||||
"balance",
|
||||
)?;
|
||||
|
||||
context.build_runtime_call(runtime_api::imports::BALANCE, &[balance.into()]);
|
||||
context.build_runtime_call(
|
||||
revive_runtime_api::polkavm_imports::BALANCE,
|
||||
&[balance.into()],
|
||||
);
|
||||
|
||||
context.build_load(balance_pointer, "balance")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user