11 return (std::string)t +
"Z";
16 result.reserve(authorizations.size());
17 for (
const auto&
a: authorizations) {
21 (
"account",
a.account.to_string())
22 (
"permission",
a.permission.to_string())
30 template<
typename ActionTrace>
33 result.reserve(actions.size());
35 std::vector<int> indices(actions.size());
36 std::iota(indices.begin(), indices.end(), 0);
37 std::sort(indices.begin(), indices.end(), [&actions](
const int& lhs,
const int& rhs) ->
bool {
38 return actions.at(lhs).global_sequence < actions.at(rhs).global_sequence;
40 for (
int index : indices) {
43 const auto&
a = actions.at(index);
46 common_mvo(
"global_sequence",
a.global_sequence)
47 (
"receiver",
a.receiver.to_string())
48 (
"account",
a.account.to_string())
49 (
"action",
a.action.to_string())
50 (
"authorization", process_authorizations(
a.authorization, yield))
54 if constexpr(std::is_same_v<ActionTrace, action_trace_v0>){
55 action_variant(std::move(common_mvo));
56 auto [
params, return_data] = data_handler(
a, yield);
58 action_variant(
"params",
params);
61 else if constexpr(std::is_same_v<ActionTrace, action_trace_v1>){
62 action_variant(std::move(common_mvo));
63 action_variant(
"return_value",
fc::to_hex(
a.return_value.data(),
a.return_value.size())) ;
64 auto [
params, return_data] = data_handler(
a, yield);
66 action_variant(
"params",
params);
68 if(return_data.has_value()){
69 action_variant(
"return_data", *return_data);
72 result.emplace_back( std::move(action_variant) );
77 template<
typename TransactionTrace>
80 result.reserve(transactions.size());
81 for (
const auto& t: transactions) {
84 if constexpr(std::is_same_v<TransactionTrace, transaction_trace_v0>){
88 (
"actions", process_actions<action_trace_v0>(t.actions, data_handler, yield)));
91 common_mvo(
"status", t.status)
92 (
"cpu_usage_us", t.cpu_usage_us)
93 (
"net_usage_words", t.net_usage_words)
94 (
"signatures", t.signatures)
95 (
"transaction_header", t.trx_header);
96 if constexpr(std::is_same_v<TransactionTrace, transaction_trace_v1>){
100 (
"actions", process_actions<action_trace_v0>(t.actions, data_handler, yield))
101 (std::move(common_mvo)));
103 else if constexpr(std::is_same_v<TransactionTrace, transaction_trace_v2>){
107 (
"actions", process_actions<action_trace_v1>(std::get<std::vector<action_trace_v1>>(t.actions), data_handler, yield))
108 (std::move(common_mvo)));
110 else if constexpr(std::is_same_v<TransactionTrace, transaction_trace_v3>){
114 (
"block_num", t.block_num)
115 (
"block_time", t.block_time)
116 (
"producer_block_id", t.producer_block_id)
117 (
"actions", process_actions<action_trace_v1>(std::get<std::vector<action_trace_v1>>(t.actions), data_handler, yield))
118 (std::move(common_mvo))
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) ;
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
thread_local yield_t yield
std::vector< fc::variant > variants
fc::string to_hex(const char *d, uint32_t s)
std::variant< block_trace_v0, block_trace_v1, block_trace_v2 > data_log_entry
std::function< std::tuple< fc::variant, std::optional< fc::variant > >(const std::variant< action_trace_v0, action_trace_v1 > &action_trace_t, const yield_function &)> data_handler_function
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
account_query_db::get_accounts_by_authorizers_params params