mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-05-07 07:07:57 +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
+2
-1
@@ -110,7 +110,8 @@ mod gas {
|
||||
let rules = utils::rules::Set::default();
|
||||
|
||||
let module = elements::deserialize_buffer(input).expect("Failed to deserialize");
|
||||
let instrumented = utils::inject_gas_counter(module, &rules).expect("Failed to instrument with gas metering");
|
||||
let instrumented = utils::inject_gas_counter(module, &rules, "env")
|
||||
.expect("Failed to instrument with gas metering");
|
||||
elements::serialize(instrumented).expect("Failed to serialize")
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user