Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
wsdb_execute.hpp
Go to the documentation of this file.
1#pragma once
10
11namespace bb::wsdb {
12
19
24 static constexpr const char MSGPACK_SCHEMA_NAME[] = "WsdbErrorResponse";
25 std::string message;
27 bool operator==(const WsdbErrorResponse&) const = default;
28};
29
63
98
103{
104 return std::move(command).visit([&request](auto&& cmd) -> WsdbCommandResponse {
105 using CmdType = std::decay_t<decltype(cmd)>;
106 return std::forward<CmdType>(cmd).execute(request);
107 });
108}
109
113WsdbCommandResponse wsdb(WsdbRequest& request, WsdbCommand&& command);
114
115} // namespace bb::wsdb
A wrapper around std::variant that provides msgpack serialization based on type names.
decltype(auto) visit(Visitor &&vis) &&
Holds the Merkle trees responsible for storing the state of the Aztec protocol.
NamedUnion< WsdbErrorResponse, WsdbGetTreeInfo::Response, WsdbGetStateReference::Response, WsdbGetInitialStateReference::Response, WsdbGetLeafValue::Response, WsdbGetLeafPreimage::Response, WsdbGetSiblingPath::Response, WsdbGetBlockNumbersForLeafIndices::Response, WsdbFindLeafIndices::Response, WsdbFindLowLeaf::Response, WsdbFindSiblingPaths::Response, WsdbAppendLeaves::Response, WsdbBatchInsert::Response, WsdbSequentialInsert::Response, WsdbUpdateArchive::Response, WsdbCommit::Response, WsdbRollback::Response, WsdbSyncBlock::Response, WsdbCreateFork::Response, WsdbDeleteFork::Response, WsdbFinalizeBlocks::Response, WsdbUnwindBlocks::Response, WsdbRemoveHistoricalBlocks::Response, WsdbGetStatus::Response, WsdbCreateCheckpoint::Response, WsdbCommitCheckpoint::Response, WsdbRevertCheckpoint::Response, WsdbCommitAllCheckpoints::Response, WsdbRevertAllCheckpoints::Response, WsdbCopyStores::Response, WsdbShutdown::Response > WsdbCommandResponse
Union of all wsdb response types.
WsdbCommandResponse execute(WsdbRequest &request, WsdbCommand &&command)
Execute a wsdb command using the visitor pattern.
NamedUnion< WsdbGetTreeInfo, WsdbGetStateReference, WsdbGetInitialStateReference, WsdbGetLeafValue, WsdbGetLeafPreimage, WsdbGetSiblingPath, WsdbGetBlockNumbersForLeafIndices, WsdbFindLeafIndices, WsdbFindLowLeaf, WsdbFindSiblingPaths, WsdbAppendLeaves, WsdbBatchInsert, WsdbSequentialInsert, WsdbUpdateArchive, WsdbCommit, WsdbRollback, WsdbSyncBlock, WsdbCreateFork, WsdbDeleteFork, WsdbFinalizeBlocks, WsdbUnwindBlocks, WsdbRemoveHistoricalBlocks, WsdbGetStatus, WsdbCreateCheckpoint, WsdbCommitCheckpoint, WsdbRevertCheckpoint, WsdbCommitAllCheckpoints, WsdbRevertAllCheckpoints, WsdbCopyStores, WsdbShutdown > WsdbCommand
Union of all wsdb commands (request types).
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Error response returned when a command fails.
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const WsdbErrorResponse &) const =default
Context passed to each command's execute() method, providing access to the WorldState.
world_state::WorldState & world_state
NamedUnion command structs for the aztec-wsdb world state database API.