mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 06:51:07 +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:
@@ -10,6 +10,80 @@ use inkwell::{context::Context, memory_buffer::MemoryBuffer, module::Module, sup
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/polkavm_imports.rs"));
|
||||
|
||||
pub static SBRK: &str = "__sbrk_internal";
|
||||
|
||||
pub static MEMORY_SIZE: &str = "__msize";
|
||||
|
||||
pub static ADDRESS: &str = "address";
|
||||
|
||||
pub static BALANCE: &str = "balance";
|
||||
|
||||
pub static BALANCE_OF: &str = "balance_of";
|
||||
|
||||
pub static BLOCK_NUMBER: &str = "block_number";
|
||||
|
||||
pub static CALL: &str = "call";
|
||||
|
||||
pub static CALLER: &str = "caller";
|
||||
|
||||
pub static CHAIN_ID: &str = "chain_id";
|
||||
|
||||
pub static CODE_SIZE: &str = "code_size";
|
||||
|
||||
pub static DEPOSIT_EVENT: &str = "deposit_event";
|
||||
|
||||
pub static GET_IMMUTABLE_DATA: &str = "get_immutable_data";
|
||||
|
||||
pub static GET_STORAGE: &str = "get_storage";
|
||||
|
||||
pub static HASH_KECCAK_256: &str = "hash_keccak_256";
|
||||
|
||||
pub static INPUT: &str = "input";
|
||||
|
||||
pub static INSTANTIATE: &str = "instantiate";
|
||||
|
||||
pub static NOW: &str = "now";
|
||||
|
||||
pub static RETURN: &str = "seal_return";
|
||||
|
||||
pub static SET_STORAGE: &str = "set_storage";
|
||||
|
||||
pub static RETURNDATACOPY: &str = "return_data_copy";
|
||||
|
||||
pub static RETURNDATASIZE: &str = "return_data_size";
|
||||
|
||||
pub static SET_IMMUTABLE_DATA: &str = "set_immutable_data";
|
||||
|
||||
pub static VALUE_TRANSFERRED: &str = "value_transferred";
|
||||
|
||||
/// All imported runtime API symbols.
|
||||
/// Useful for configuring common attributes and linkage.
|
||||
pub static IMPORTS: [&str; 23] = [
|
||||
SBRK,
|
||||
MEMORY_SIZE,
|
||||
ADDRESS,
|
||||
BALANCE,
|
||||
BALANCE_OF,
|
||||
BLOCK_NUMBER,
|
||||
CALL,
|
||||
CALLER,
|
||||
CHAIN_ID,
|
||||
CODE_SIZE,
|
||||
DEPOSIT_EVENT,
|
||||
GET_IMMUTABLE_DATA,
|
||||
GET_STORAGE,
|
||||
HASH_KECCAK_256,
|
||||
INPUT,
|
||||
INSTANTIATE,
|
||||
NOW,
|
||||
RETURN,
|
||||
RETURNDATACOPY,
|
||||
RETURNDATASIZE,
|
||||
SET_IMMUTABLE_DATA,
|
||||
SET_STORAGE,
|
||||
VALUE_TRANSFERRED,
|
||||
];
|
||||
|
||||
/// Creates a LLVM module from the [BITCODE].
|
||||
/// The module imports `pallet-revive` runtime API functions.
|
||||
/// Returns `Error` if the bitcode fails to parse, which should never happen.
|
||||
|
||||
Reference in New Issue
Block a user