mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-12 21:41:06 +00:00
Introduce substrate contracts support.
This commit is contained in:
+24
-4
@@ -9,10 +9,6 @@ extern crate parity_wasm;
|
||||
extern crate byteorder;
|
||||
#[macro_use] extern crate log;
|
||||
|
||||
pub static CREATE_SYMBOL: &'static str = "deploy";
|
||||
pub static CALL_SYMBOL: &'static str = "call";
|
||||
pub static RET_SYMBOL: &'static str = "ret";
|
||||
|
||||
pub mod rules;
|
||||
|
||||
mod build;
|
||||
@@ -32,6 +28,30 @@ pub use ext::{externalize, externalize_mem, underscore_funcs, ununderscore_funcs
|
||||
pub use pack::{pack_instance, Error as PackingError};
|
||||
pub use runtime_type::inject_runtime_type;
|
||||
|
||||
pub struct TargetRuntime {
|
||||
pub create_symbol: &'static str,
|
||||
pub call_symbol: &'static str,
|
||||
pub return_symbol: &'static str,
|
||||
}
|
||||
|
||||
impl TargetRuntime {
|
||||
pub fn substrate() -> TargetRuntime {
|
||||
TargetRuntime {
|
||||
create_symbol: "deploy",
|
||||
call_symbol: "call",
|
||||
return_symbol: "ext_return",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pwasm() -> TargetRuntime {
|
||||
TargetRuntime {
|
||||
create_symbol: "deploy",
|
||||
call_symbol: "call",
|
||||
return_symbol: "ret",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
mod std {
|
||||
pub use core::*;
|
||||
|
||||
Reference in New Issue
Block a user