Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::nodejs::WorldStateWrapper Class Reference

Manages the interaction between the JavaScript runtime and the WorldState class. More...

#include <world_state.hpp>

Inheritance diagram for bb::nodejs::WorldStateWrapper:

Public Member Functions

 WorldStateWrapper (const Napi::CallbackInfo &)
 
Napi::Value call (const Napi::CallbackInfo &)
 The only instance method exposed to JavaScript. Takes a msgpack Message and returns a Promise.
 
Napi::Value getHandle (const Napi::CallbackInfo &)
 Get a NAPI External handle to the underlying WorldState pointer. This allows other NAPI functions to access the WorldState instance directly.
 

Static Public Member Functions

static Napi::Function get_class (Napi::Env)
 Register the WorldStateAddon class with the JavaScript runtime.
 

Private Member Functions

bool get_tree_info (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool get_state_reference (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool get_initial_state_reference (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool get_leaf_value (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool get_leaf_preimage (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool get_sibling_path (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool get_block_numbers_for_leaf_indices (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool find_leaf_indices (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool find_low_leaf (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool find_sibling_paths (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool append_leaves (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool batch_insert (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool sequential_insert (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool update_archive (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool commit (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool rollback (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool sync_block (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool create_fork (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool delete_fork (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool close (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool set_finalized (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool unwind (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool remove_historical (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool get_status (msgpack::object &obj, msgpack::sbuffer &buffer) const
 
bool checkpoint (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool commit_checkpoint (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool revert_checkpoint (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool commit_all_checkpoints (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool revert_all_checkpoints (msgpack::object &obj, msgpack::sbuffer &buffer)
 
bool copy_stores (msgpack::object &obj, msgpack::sbuffer &buffer)
 

Private Attributes

std::unique_ptr< bb::world_state::WorldState_ws
 
bb::messaging::MessageDispatcher _dispatcher
 

Detailed Description

Manages the interaction between the JavaScript runtime and the WorldState class.

Definition at line 16 of file world_state.hpp.

Constructor & Destructor Documentation

◆ WorldStateWrapper()

WorldStateWrapper::WorldStateWrapper ( const Napi::CallbackInfo &  info)

Definition at line 36 of file world_state.cpp.

Member Function Documentation

◆ append_leaves()

bool WorldStateWrapper::append_leaves ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 584 of file world_state.cpp.

◆ batch_insert()

bool WorldStateWrapper::batch_insert ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 619 of file world_state.cpp.

◆ call()

Napi::Value WorldStateWrapper::call ( const Napi::CallbackInfo &  info)

The only instance method exposed to JavaScript. Takes a msgpack Message and returns a Promise.

Definition at line 279 of file world_state.cpp.

◆ checkpoint()

bool WorldStateWrapper::checkpoint ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 841 of file world_state.cpp.

◆ close()

bool WorldStateWrapper::close ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 784 of file world_state.cpp.

◆ commit()

bool WorldStateWrapper::commit ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 705 of file world_state.cpp.

◆ commit_all_checkpoints()

bool WorldStateWrapper::commit_all_checkpoints ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 883 of file world_state.cpp.

◆ commit_checkpoint()

bool WorldStateWrapper::commit_checkpoint ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 855 of file world_state.cpp.

◆ copy_stores()

bool WorldStateWrapper::copy_stores ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 926 of file world_state.cpp.

◆ create_fork()

bool WorldStateWrapper::create_fork ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 753 of file world_state.cpp.

◆ delete_fork()

bool WorldStateWrapper::delete_fork ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 770 of file world_state.cpp.

◆ find_leaf_indices()

bool WorldStateWrapper::find_leaf_indices ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 485 of file world_state.cpp.

◆ find_low_leaf()

bool WorldStateWrapper::find_low_leaf ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 568 of file world_state.cpp.

◆ find_sibling_paths()

bool WorldStateWrapper::find_sibling_paths ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 527 of file world_state.cpp.

◆ get_block_numbers_for_leaf_indices()

bool WorldStateWrapper::get_block_numbers_for_leaf_indices ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 467 of file world_state.cpp.

◆ get_class()

Napi::Function WorldStateWrapper::get_class ( Napi::Env  env)
static

Register the WorldStateAddon class with the JavaScript runtime.

Definition at line 940 of file world_state.cpp.

◆ get_initial_state_reference()

bool WorldStateWrapper::get_initial_state_reference ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 359 of file world_state.cpp.

◆ get_leaf_preimage()

bool WorldStateWrapper::get_leaf_preimage ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 418 of file world_state.cpp.

◆ get_leaf_value()

bool WorldStateWrapper::get_leaf_value ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 374 of file world_state.cpp.

◆ get_sibling_path()

bool WorldStateWrapper::get_sibling_path ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 452 of file world_state.cpp.

◆ get_state_reference()

bool WorldStateWrapper::get_state_reference ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 344 of file world_state.cpp.

◆ get_status()

bool WorldStateWrapper::get_status ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 911 of file world_state.cpp.

◆ get_tree_info()

bool WorldStateWrapper::get_tree_info ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 327 of file world_state.cpp.

◆ getHandle()

Napi::Value WorldStateWrapper::getHandle ( const Napi::CallbackInfo &  info)

Get a NAPI External handle to the underlying WorldState pointer. This allows other NAPI functions to access the WorldState instance directly.

Definition at line 314 of file world_state.cpp.

◆ remove_historical()

bool WorldStateWrapper::remove_historical ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 827 of file world_state.cpp.

◆ revert_all_checkpoints()

bool WorldStateWrapper::revert_all_checkpoints ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 897 of file world_state.cpp.

◆ revert_checkpoint()

bool WorldStateWrapper::revert_checkpoint ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 869 of file world_state.cpp.

◆ rollback()

bool WorldStateWrapper::rollback ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 720 of file world_state.cpp.

◆ sequential_insert()

bool WorldStateWrapper::sequential_insert ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 655 of file world_state.cpp.

◆ set_finalized()

bool WorldStateWrapper::set_finalized ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 800 of file world_state.cpp.

◆ sync_block()

bool WorldStateWrapper::sync_block ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 734 of file world_state.cpp.

◆ unwind()

bool WorldStateWrapper::unwind ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
) const
private

Definition at line 813 of file world_state.cpp.

◆ update_archive()

bool WorldStateWrapper::update_archive ( msgpack::object &  obj,
msgpack::sbuffer &  buffer 
)
private

Definition at line 691 of file world_state.cpp.

Member Data Documentation

◆ _dispatcher

bb::messaging::MessageDispatcher bb::nodejs::WorldStateWrapper::_dispatcher
private

Definition at line 38 of file world_state.hpp.

◆ _ws

std::unique_ptr<bb::world_state::WorldState> bb::nodejs::WorldStateWrapper::_ws
private

Definition at line 37 of file world_state.hpp.


The documentation for this class was generated from the following files: