add missing wasm runtime function (#29)

This commit is contained in:
laizy 2023-01-06 00:49:21 +08:00 committed by GitHub
parent 06eb0759e0
commit ab7f9ec3a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -82,6 +82,8 @@ impl WitnessCalculator {
"log" => runtime::log_component(store),
"exceptionHandler" => runtime::exception_handler(store),
"showSharedRWMemory" => runtime::show_memory(store),
"printErrorMessage" => runtime::print_error_message(store),
"writeBufferMessage" => runtime::write_buffer_message(store),
}
};
let instance = Wasm::new(Instance::new(&module, &import_object)?);
@ -333,6 +335,20 @@ mod runtime {
Function::new_native(store, func)
}
// Circom 2.0
pub fn print_error_message(store: &Store) -> Function {
#[allow(unused)]
fn func() {}
Function::new_native(store, func)
}
// Circom 2.0
pub fn write_buffer_message(store: &Store) -> Function {
#[allow(unused)]
fn func() {}
Function::new_native(store, func)
}
pub fn log_signal(store: &Store) -> Function {
#[allow(unused)]
fn func(a: i32, b: i32) {}