MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / fuel_consumed

Function fuel_consumed

tests/all/fuel.rs:51–58  ·  view source on GitHub ↗
(config: &Config, wasm: &[u8])

Source from the content-addressed store, hash-verified

49}
50
51fn fuel_consumed(config: &Config, wasm: &[u8]) -> Result<u64> {
52 let engine = Engine::new(&config)?;
53 let module = Module::new(&engine, wasm)?;
54 let mut store = Store::new(&engine, ());
55 store.set_fuel(u64::MAX)?;
56 drop(Instance::new(&mut store, &module, &[]));
57 Ok(u64::MAX - store.get_fuel()?)
58}
59
60#[wasmtime_test(wasm_features(gc, function_references, bulk_memory))]
61#[cfg_attr(miri, ignore)]

Callers 1

runFunction · 0.85

Calls 5

OkFunction · 0.85
newFunction · 0.50
dropFunction · 0.50
set_fuelMethod · 0.45
get_fuelMethod · 0.45

Tested by

no test coverage detected