Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::trace_api::detail::response_formatter Class Reference

#include <request_handler.hpp>

Static Public Member Functions

static fc::variant process_block (const data_log_entry &trace, bool irreversible, const data_handler_function &data_handler, const yield_function &yield)
 

Detailed Description

Definition at line 12 of file request_handler.hpp.

Member Function Documentation

◆ process_block()

fc::variant sysio::trace_api::detail::response_formatter::process_block ( const data_log_entry & trace,
bool irreversible,
const data_handler_function & data_handler,
const yield_function & yield )
static

Definition at line 129 of file request_handler.cpp.

129 {
130 auto common_mvo = std::visit([&](auto&& arg) -> fc::mutable_variant_object {
132 ("id", arg.id.str())
133 ("number", arg.number )
134 ("previous_id", arg.previous_id.str())
135 ("status", irreversible ? "irreversible" : "pending" )
136 ("timestamp", to_iso8601_datetime(arg.timestamp))
137 ("producer", arg.producer.to_string());}, trace);
138 if (std::holds_alternative<block_trace_v0> (trace)){
139 auto& block_trace = std::get<block_trace_v0>(trace);
141 (std::move(common_mvo))
142 ("transactions", process_transactions<transaction_trace_v0>(block_trace.transactions, data_handler, yield ));
143 }else if(std::holds_alternative<block_trace_v1>(trace)){
144 auto& block_trace = std::get<block_trace_v1>(trace);
146 (std::move(common_mvo))
147 ("transaction_mroot", block_trace.transaction_mroot)
148 ("action_mroot", block_trace.action_mroot)
149 ("schedule_version", block_trace.schedule_version)
150 ("transactions", process_transactions<transaction_trace_v1>( block_trace.transactions_v1, data_handler, yield )) ;
151 }else if(std::holds_alternative<block_trace_v2>(trace)){
152 auto& block_trace = std::get<block_trace_v2>(trace);
153 auto transactions = std::visit([&](auto&& arg){
154 return process_transactions(arg, data_handler, yield);
155 }, block_trace.transactions);
157 (std::move(common_mvo))
158 ("transaction_mroot", block_trace.transaction_mroot)
159 ("action_mroot", block_trace.action_mroot)
160 ("schedule_version", block_trace.schedule_version)
161 ("transactions", transactions) ;
162 }else{
164 }
165 }
An order-preserving dictionary of variants.

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