|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Namespaces | |
| namespace | lmdb_store |
| namespace | msgpack_client |
Typedefs | |
| using | async_fn = std::function< void(msgpack::sbuffer &)> |
Enumerations | |
| enum | WorldStateMessageType { GET_TREE_INFO = FIRST_APP_MSG_TYPE , GET_STATE_REFERENCE , GET_INITIAL_STATE_REFERENCE , GET_LEAF_VALUE , GET_LEAF_PREIMAGE , GET_SIBLING_PATH , GET_BLOCK_NUMBERS_FOR_LEAF_INDICES , FIND_LEAF_INDICES , FIND_LOW_LEAF , FIND_SIBLING_PATHS , APPEND_LEAVES , BATCH_INSERT , SEQUENTIAL_INSERT , UPDATE_ARCHIVE , COMMIT , ROLLBACK , SYNC_BLOCK , CREATE_FORK , DELETE_FORK , FINALIZE_BLOCKS , UNWIND_BLOCKS , REMOVE_HISTORICAL_BLOCKS , GET_STATUS , CREATE_CHECKPOINT , COMMIT_CHECKPOINT , REVERT_CHECKPOINT , COMMIT_ALL_CHECKPOINTS , REVERT_ALL_CHECKPOINTS , COPY_STORES , CLOSE = 999 } |
Functions | |
| std::string | extract_error_from_napi_value (const Napi::CallbackInfo &cb_info) |
| Extracts error message from a Napi value (string or Error object) | |
| Napi::Function | create_buffer_resolve_handler (Napi::Env env, std::shared_ptr< CallbackResults > cb_results) |
| Creates a resolve handler for promises that return Buffer | undefined. | |
| Napi::Function | create_string_resolve_handler (Napi::Env env, std::shared_ptr< CallbackResults > cb_results) |
| Creates a resolve handler for promises that return string | undefined. | |
| Napi::Function | create_void_resolve_handler (Napi::Env env, std::shared_ptr< CallbackResults > cb_results) |
| Creates a resolve handler for promises that return void. | |
| Napi::Function | create_reject_handler (Napi::Env env, std::shared_ptr< CallbackResults > cb_results) |
| Creates a reject handler for promises. | |
| void | attach_promise_handlers (Napi::Promise promise, Napi::Function resolve_handler, Napi::Function reject_handler) |
| Attaches resolve and reject handlers to a promise. | |
| template<typename T > | |
| std::vector< uint8_t > | serialize_to_msgpack (const T &data) |
| Serializes data to msgpack format. | |
| template<typename T > | |
| T | deserialize_from_msgpack (const std::vector< uint8_t > &data, const std::string &type_name) |
| Deserializes msgpack data to a specific type. | |
| std::optional< std::vector< uint8_t > > | invoke_ts_callback_with_promise (const Napi::ThreadSafeFunction &callback, const std::string &operation_name, std::function< void(Napi::Env, Napi::Function, std::shared_ptr< CallbackResults >)> call_js_function, std::chrono::seconds timeout=std::chrono::seconds(30)) |
| Generic callback invoker that handles the full BlockingCall pattern. | |
| std::optional< std::vector< uint8_t > > | invoke_single_string_callback (const Napi::ThreadSafeFunction &callback, const std::string &input_str, const std::string &operation_name) |
| Helper for callbacks that take a single string argument and return Buffer | undefined. | |
| std::optional< std::vector< uint8_t > > | invoke_double_string_callback (const Napi::ThreadSafeFunction &callback, const std::string &input_str1, const std::string &input_str2, const std::string &operation_name) |
| Helper for callbacks that take two string arguments and return string | undefined. | |
| void | invoke_buffer_void_callback (const Napi::ThreadSafeFunction &callback, std::vector< uint8_t > buffer_data, const std::string &operation_name) |
| Helper for callbacks that take a buffer and return void. | |
| template std::vector< uint8_t > | serialize_to_msgpack (const bb::avm2::ContractDeploymentData &data) |
| template bb::avm2::ContractInstance | deserialize_from_msgpack (const std::vector< uint8_t > &data, const std::string &type_name) |
| std::string | ff_to_string (const bb::avm2::FF &value) |
| Converts an FF (field element) to a hex string. | |
| Napi::Promise | promise_reject (const Napi::Env &env, const Napi::Value &err) |
| using bb::nodejs::async_fn = typedef std::function<void(msgpack::sbuffer&)> |
Definition at line 10 of file async_op.hpp.
Definition at line 20 of file world_state_message.hpp.
| void bb::nodejs::attach_promise_handlers | ( | Napi::Promise | promise, |
| Napi::Function | resolve_handler, | ||
| Napi::Function | reject_handler | ||
| ) |
Attaches resolve and reject handlers to a promise.
Definition at line 118 of file ts_callback_utils.cpp.
| Napi::Function bb::nodejs::create_buffer_resolve_handler | ( | Napi::Env | env, |
| std::shared_ptr< CallbackResults > | cb_results | ||
| ) |
Creates a resolve handler for promises that return Buffer | undefined.
Definition at line 28 of file ts_callback_utils.cpp.
| Napi::Function bb::nodejs::create_reject_handler | ( | Napi::Env | env, |
| std::shared_ptr< CallbackResults > | cb_results | ||
| ) |
Creates a reject handler for promises.
Definition at line 105 of file ts_callback_utils.cpp.
| Napi::Function bb::nodejs::create_string_resolve_handler | ( | Napi::Env | env, |
| std::shared_ptr< CallbackResults > | cb_results | ||
| ) |
Creates a resolve handler for promises that return string | undefined.
Definition at line 61 of file ts_callback_utils.cpp.
| Napi::Function bb::nodejs::create_void_resolve_handler | ( | Napi::Env | env, |
| std::shared_ptr< CallbackResults > | cb_results | ||
| ) |
Creates a resolve handler for promises that return void.
Definition at line 93 of file ts_callback_utils.cpp.
| T bb::nodejs::deserialize_from_msgpack | ( | const std::vector< uint8_t > & | data, |
| const std::string & | type_name | ||
| ) |
Deserializes msgpack data to a specific type.
Definition at line 136 of file ts_callback_utils.cpp.
| template bb::avm2::ContractInstance bb::nodejs::deserialize_from_msgpack | ( | const std::vector< uint8_t > & | data, |
| const std::string & | type_name | ||
| ) |
| std::string bb::nodejs::extract_error_from_napi_value | ( | const Napi::CallbackInfo & | cb_info | ) |
Extracts error message from a Napi value (string or Error object)
Definition at line 11 of file ts_callback_utils.cpp.
| std::string bb::nodejs::ff_to_string | ( | const bb::avm2::FF & | value | ) |
Converts an FF (field element) to a hex string.
| void bb::nodejs::invoke_buffer_void_callback | ( | const Napi::ThreadSafeFunction & | callback, |
| std::vector< uint8_t > | buffer_data, | ||
| const std::string & | operation_name | ||
| ) |
Helper for callbacks that take a buffer and return void.
Definition at line 252 of file ts_callback_utils.cpp.
| std::optional< std::vector< uint8_t > > bb::nodejs::invoke_double_string_callback | ( | const Napi::ThreadSafeFunction & | callback, |
| const std::string & | input_str1, | ||
| const std::string & | input_str2, | ||
| const std::string & | operation_name | ||
| ) |
Helper for callbacks that take two string arguments and return string | undefined.
Definition at line 224 of file ts_callback_utils.cpp.
| std::optional< std::vector< uint8_t > > bb::nodejs::invoke_single_string_callback | ( | const Napi::ThreadSafeFunction & | callback, |
| const std::string & | input_str, | ||
| const std::string & | operation_name | ||
| ) |
Helper for callbacks that take a single string argument and return Buffer | undefined.
Definition at line 199 of file ts_callback_utils.cpp.
| std::optional< std::vector< uint8_t > > bb::nodejs::invoke_ts_callback_with_promise | ( | const Napi::ThreadSafeFunction & | callback, |
| const std::string & | operation_name, | ||
| std::function< void(Napi::Env, Napi::Function, std::shared_ptr< CallbackResults >)> | call_js_function, | ||
| std::chrono::seconds | timeout = std::chrono::seconds(30) |
||
| ) |
Generic callback invoker that handles the full BlockingCall pattern.
This template function encapsulates the entire promise-based async callback flow:
Definition at line 149 of file ts_callback_utils.cpp.
| Napi::Promise bb::nodejs::promise_reject | ( | const Napi::Env & | env, |
| const Napi::Value & | err | ||
| ) |
Definition at line 6 of file promise.cpp.
| template std::vector< uint8_t > bb::nodejs::serialize_to_msgpack | ( | const bb::avm2::ContractDeploymentData & | data | ) |
| std::vector< uint8_t > bb::nodejs::serialize_to_msgpack | ( | const T & | data | ) |
Serializes data to msgpack format.
Definition at line 129 of file ts_callback_utils.cpp.