Browse Source

add missing wasm runtime function (#29)

pull/3/head
laizy 1 year ago
committed by GitHub
parent
commit
ab7f9ec3a1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      src/witness/witness_calculator.rs

+ 16
- 0
src/witness/witness_calculator.rs

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

Loading…
Cancel
Save