MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / contract_functions

Function contract_functions

runtime/src/contract.rs:53–68  ·  view source on GitHub ↗

for debugging exportable functions

(bytes: &[u8])

Source from the content-addressed store, hash-verified

51
52// for debugging exportable functions
53fn contract_functions(bytes: &[u8]) -> Vec<String> {
54 let mut config = Config::new();
55 let mut exports = vec![];
56
57 Config::wasm_component_model(&mut config, true);
58
59 if let Ok(engine) = Engine::new(&config) {
60 exports = wasmtime::Module::from_binary(&engine, bytes)
61 .unwrap()
62 .exports()
63 .map(|export| export.name().to_string())
64 .collect();
65 }
66
67 exports
68}
69
70#[cfg(test)]
71mod tests {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected