mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-09 20:11:06 +00:00
Allow specifying the module of the imported 'gas' function (#140)
* No need for mem::replace when doing a simple assignment * Allow specifying the module of the imported 'gas' function This allows users to place the imported function inside a custom module instead of the generic 'env' module.
This commit is contained in:
committed by
GitHub
parent
b61f6dd52f
commit
409ced002a
+1
-1
@@ -17,7 +17,7 @@ fn main() {
|
||||
let module = parity_wasm::deserialize_file(&args[1]).expect("Module deserialization to succeed");
|
||||
|
||||
let result = utils::inject_gas_counter(
|
||||
module, &Default::default()
|
||||
module, &Default::default(), "env"
|
||||
).expect("Failed to inject gas. Some forbidden opcodes?");
|
||||
|
||||
parity_wasm::serialize_to_file(&args[2], result).expect("Module serialization to succeed")
|
||||
|
||||
Reference in New Issue
Block a user