mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-23 16:41:02 +00:00
tabify all
This commit is contained in:
+12
-12
@@ -5,20 +5,20 @@ use std::env;
|
||||
|
||||
fn main() {
|
||||
|
||||
wasm_utils::init_log();
|
||||
wasm_utils::init_log();
|
||||
|
||||
let args = env::args().collect::<Vec<_>>();
|
||||
if args.len() < 3 {
|
||||
println!("Usage: {} input_file.wasm output_file.wasm", args[0]);
|
||||
return;
|
||||
}
|
||||
let args = env::args().collect::<Vec<_>>();
|
||||
if args.len() < 3 {
|
||||
println!("Usage: {} input_file.wasm output_file.wasm", args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
let mut module = parity_wasm::deserialize_file(&args[1]).unwrap();
|
||||
let mut module = parity_wasm::deserialize_file(&args[1]).unwrap();
|
||||
|
||||
// Invoke optimizer
|
||||
// Contract is supposed to have only these functions as public api
|
||||
// All other symbols not usable by this list is optimized away
|
||||
wasm_utils::optimize(&mut module, vec!["_call"]).expect("Optimizer to finish without errors");
|
||||
// Invoke optimizer
|
||||
// Contract is supposed to have only these functions as public api
|
||||
// All other symbols not usable by this list is optimized away
|
||||
wasm_utils::optimize(&mut module, vec!["_call"]).expect("Optimizer to finish without errors");
|
||||
|
||||
parity_wasm::serialize_to_file(&args[2], module).unwrap();
|
||||
parity_wasm::serialize_to_file(&args[2], module).unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user