mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-07-03 00:11:42 +00:00
Introduce substrate contracts support.
This commit is contained in:
28
src/lib.rs
28
src/lib.rs
@ -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