mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-03-15 19:20:48 +00:00
Merge pull request #114 from paritytech/ret
"return_ "-> "ret" in public api
This commit is contained in:
commit
8ecbc8ddcc
@ -34,7 +34,7 @@ pub use runtime_type::inject_runtime_type;
|
||||
pub struct TargetSymbols {
|
||||
pub create: &'static str,
|
||||
pub call: &'static str,
|
||||
pub return_: &'static str,
|
||||
pub ret: &'static str,
|
||||
}
|
||||
|
||||
pub enum TargetRuntime {
|
||||
@ -48,7 +48,7 @@ impl TargetRuntime {
|
||||
TargetRuntime::Substrate(TargetSymbols {
|
||||
create: "deploy",
|
||||
call: "call",
|
||||
return_: "ext_return",
|
||||
ret: "ext_return",
|
||||
})
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ impl TargetRuntime {
|
||||
TargetRuntime::PWasm(TargetSymbols {
|
||||
create: "deploy",
|
||||
call: "call",
|
||||
return_: "ret",
|
||||
ret: "ret",
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ pub fn pack_instance(raw_module: Vec<u8>, mut ctor_module: elements::Module, tar
|
||||
let mut found = false;
|
||||
for entry in ctor_module.import_section().ok_or(Error::NoImportSection)?.entries().iter() {
|
||||
if let External::Function(_) = *entry.external() {
|
||||
if entry.field() == target.symbols().return_ { found = true; break; }
|
||||
if entry.field() == target.symbols().ret { found = true; break; }
|
||||
else { id += 1; }
|
||||
}
|
||||
}
|
||||
@ -102,7 +102,7 @@ pub fn pack_instance(raw_module: Vec<u8>, mut ctor_module: elements::Module, tar
|
||||
mbuilder.push_import(
|
||||
builder::import()
|
||||
.module("env")
|
||||
.field(&target.symbols().return_)
|
||||
.field(&target.symbols().ret)
|
||||
.external().func(import_sig)
|
||||
.build()
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user