diff --git a/src/lib.rs b/src/lib.rs index 97bfe3e..307c7ad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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", }) } diff --git a/src/pack.rs b/src/pack.rs index 4a148f8..8563178 100644 --- a/src/pack.rs +++ b/src/pack.rs @@ -87,7 +87,7 @@ pub fn pack_instance(raw_module: Vec, 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, 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() );