From ab7f9ec3a1202117981eb59854fa1aae2b1e4fee Mon Sep 17 00:00:00 2001 From: laizy Date: Fri, 6 Jan 2023 00:49:21 +0800 Subject: [PATCH] add missing wasm runtime function (#29) --- src/witness/witness_calculator.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/witness/witness_calculator.rs b/src/witness/witness_calculator.rs index 341bc9d..479fae6 100644 --- a/src/witness/witness_calculator.rs +++ b/src/witness/witness_calculator.rs @@ -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) {}