Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::trace_api Namespace Reference

Namespaces

namespace  configuration_utils
 
namespace  detail
 
namespace  test_common
 

Classes

class  abi_data_handler
 
struct  action_trace_v0
 
struct  action_trace_v1
 
struct  authorization_trace_v0
 
class  bad_data_exception
 
struct  block_entry_v0
 
struct  block_trace_v0
 
struct  block_trace_v1
 
struct  block_trace_v2
 
struct  block_trxs_entry
 
struct  cache_trace
 
class  chain_extraction_impl_type
 
struct  command_registration
 
class  compressed_file
 
class  compressed_file_datastream
 
class  compressed_file_error
 
struct  compressed_file_impl
 
class  incompatible_slice_files
 
struct  lib_entry_v0
 
class  malformed_slice_file
 
class  old_slice_version
 
class  path_does_not_exist
 
class  request_handler
 
class  slice_directory
 
class  store_provider
 
struct  transaction_trace_v0
 
struct  transaction_trace_v1
 
struct  transaction_trace_v2
 
struct  transaction_trace_v3
 
class  yield_exception
 

Typedefs

using yield_function = fc::optional_delegate<void()>
 
using exception_with_context = std::tuple<const std::exception_ptr&, char const *, uint64_t, char const *>
 
using exception_handler = fc::optional_delegate<void(const exception_with_context&)>
 
using log_handler = fc::optional_delegate<void(const std::string&)>
 
using get_block_t = std::optional<std::tuple<data_log_entry, bool>>
 
using get_block_n = std::optional<uint32_t>
 
using data_log_entry
 
using metadata_log_entry
 
using data_handler_function = 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&)>
 
using command_fn = std::function<int( const bpo::variables_map&, const std::vector<std::string>&)>
 

Functions

template<typename ActionTrace >
ActionTrace to_action_trace (const chain::action_trace &at)
 Used by to_transaction_trace for creation of action_trace_v0 or action_trace_v1.
 
template<typename TransactionTrace >
TransactionTrace to_transaction_trace (const cache_trace &t)
 
block_trace_v2 create_block_trace (const chain::block_state_ptr &bsp)
 
bool operator== (const authorization_trace_v0 &lhs, const authorization_trace_v0 &rhs)
 
bool operator== (const action_trace_v0 &lhs, const action_trace_v0 &rhs)
 
bool operator== (const transaction_trace_v0 &lhs, const transaction_trace_v0 &rhs)
 
bool operator== (const transaction_trace_v2 &lhs, const transaction_trace_v2 &rhs)
 
bool operator== (const block_trace_v0 &lhs, const block_trace_v0 &rhs)
 
bool operator== (const block_trace_v2 &lhs, const block_trace_v2 &rhs)
 
std::ostream & operator<< (std::ostream &os, const block_trace_v0 &bt)
 
std::ostream & operator<< (std::ostream &os, const block_trace_v2 &bt)
 
bool operator== (const block_entry_v0 &lhs, const block_entry_v0 &rhs)
 
bool operator!= (const block_entry_v0 &lhs, const block_entry_v0 &rhs)
 
bool operator== (const lib_entry_v0 &lhs, const lib_entry_v0 &rhs)
 
bool operator!= (const lib_entry_v0 &lhs, const lib_entry_v0 &rhs)
 
std::ostream & operator<< (std::ostream &os, const block_entry_v0 &be)
 
std::ostream & operator<< (std::ostream &os, const lib_entry_v0 &le)
 

Typedef Documentation

◆ command_fn

using sysio::trace_api::command_fn = std::function<int( const bpo::variables_map&, const std::vector<std::string>&)>

passes global opts and then the remaining command line

Definition at line 15 of file cmd_registration.hpp.

◆ data_handler_function

using sysio::trace_api::data_handler_function = 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&)>

Definition at line 9 of file request_handler.hpp.

◆ data_log_entry

Initial value:
std::variant<
block_trace_v0,
block_trace_v1,
block_trace_v2
>

Definition at line 9 of file data_log.hpp.

◆ exception_handler

◆ exception_with_context

using sysio::trace_api::exception_with_context = std::tuple<const std::exception_ptr&, char const *, uint64_t, char const *>

Definition at line 40 of file common.hpp.

◆ get_block_n

using sysio::trace_api::get_block_n = std::optional<uint32_t>

Definition at line 51 of file common.hpp.

◆ get_block_t

using sysio::trace_api::get_block_t = std::optional<std::tuple<data_log_entry, bool>>

Definition at line 49 of file common.hpp.

◆ log_handler

using sysio::trace_api::log_handler = fc::optional_delegate<void(const std::string&)>

Definition at line 43 of file common.hpp.

◆ metadata_log_entry

Initial value:
std::variant<
block_entry_v0,
lib_entry_v0,
block_trxs_entry
>

Definition at line 18 of file metadata_log.hpp.

◆ yield_function

A function used to separate cooperative or external concerns from long running tasks calling code should expect that this can throw yield_exception and gracefully unwind if it does

Exceptions
yield_exceptionif the provided yield needs to terminate the long running process for any reason

Definition at line 13 of file common.hpp.

Function Documentation

◆ create_block_trace()

block_trace_v2 sysio::trace_api::create_block_trace ( const chain::block_state_ptr & bsp)
inline

Definition at line 66 of file extract_util.hpp.

66 {
68 r.id = bsp->id;
69 r.number = bsp->block_num;
70 r.previous_id = bsp->block->previous;
71 r.timestamp = bsp->block->timestamp;
72 r.producer = bsp->block->producer;
73 r.schedule_version = bsp->block->schedule_version;
74 r.transaction_mroot = bsp->block->transaction_mroot;
75 r.action_mroot = bsp->block->action_mroot;
76 return r;
77}
const mie::Vuint & r
Definition bn.cpp:28

◆ operator!=() [1/2]

bool sysio::trace_api::operator!= ( const block_entry_v0 & lhs,
const block_entry_v0 & rhs )

Definition at line 223 of file test_common.hpp.

223 {
224 return !(lhs == rhs);
225 }

◆ operator!=() [2/2]

bool sysio::trace_api::operator!= ( const lib_entry_v0 & lhs,
const lib_entry_v0 & rhs )

Definition at line 232 of file test_common.hpp.

232 {
233 return !(lhs == rhs);
234 }

◆ operator<<() [1/4]

std::ostream & sysio::trace_api::operator<< ( std::ostream & os,
const block_entry_v0 & be )

Definition at line 236 of file test_common.hpp.

236 {
238 return os;
239 }
static string to_string(const variant &v, const yield_function_t &yield, const output_formatting format=output_formatting::stringify_large_ints_and_doubles)
Definition json.cpp:674
static constexpr time_point maximum()
Definition time.hpp:46
os_t os
Here is the call graph for this function:

◆ operator<<() [2/4]

std::ostream & sysio::trace_api::operator<< ( std::ostream & os,
const block_trace_v0 & bt )

Definition at line 206 of file test_common.hpp.

206 {
208 return os;
209 }
void bt(const Operand &op, const Reg &reg)
Here is the call graph for this function:

◆ operator<<() [3/4]

std::ostream & sysio::trace_api::operator<< ( std::ostream & os,
const block_trace_v2 & bt )

Definition at line 211 of file test_common.hpp.

211 {
213 return os;
214 }
Here is the call graph for this function:

◆ operator<<() [4/4]

std::ostream & sysio::trace_api::operator<< ( std::ostream & os,
const lib_entry_v0 & le )

Definition at line 241 of file test_common.hpp.

241 {
243 return os;
244 }
Here is the call graph for this function:

◆ operator==() [1/8]

bool sysio::trace_api::operator== ( const action_trace_v0 & lhs,
const action_trace_v0 & rhs )

Definition at line 151 of file test_common.hpp.

151 {
152 return
153 lhs.global_sequence == rhs.global_sequence &&
154 lhs.receiver == rhs.receiver &&
155 lhs.account == rhs.account &&
156 lhs.action == rhs.action &&
157 lhs.authorization == rhs.authorization &&
158 lhs.data == rhs.data;
159 }
std::vector< authorization_trace_v0 > authorization
Definition trace.hpp:20

◆ operator==() [2/8]

bool sysio::trace_api::operator== ( const authorization_trace_v0 & lhs,
const authorization_trace_v0 & rhs )

Definition at line 145 of file test_common.hpp.

145 {
146 return
147 lhs.account == rhs.account &&
148 lhs.permission == rhs.permission;
149 }

◆ operator==() [3/8]

bool sysio::trace_api::operator== ( const block_entry_v0 & lhs,
const block_entry_v0 & rhs )

Definition at line 216 of file test_common.hpp.

216 {
217 return
218 lhs.id == rhs.id &&
219 lhs.number == rhs.number &&
220 lhs.offset == rhs.offset;
221 }
uint64_t offset
chain::block_id_type id
uint32_t number

◆ operator==() [4/8]

bool sysio::trace_api::operator== ( const block_trace_v0 & lhs,
const block_trace_v0 & rhs )

Definition at line 183 of file test_common.hpp.

183 {
184 return
185 lhs.id == rhs.id &&
186 lhs.number == rhs.number &&
187 lhs.previous_id == rhs.previous_id &&
188 lhs.timestamp == rhs.timestamp &&
189 lhs.producer == rhs.producer &&
190 lhs.transactions == rhs.transactions;
191 }
std::vector< transaction_trace_v0 > transactions
Definition trace.hpp:66
chain::block_id_type previous_id
Definition trace.hpp:63
chain::block_id_type id
Definition trace.hpp:61
chain::block_timestamp_type timestamp
Definition trace.hpp:64

◆ operator==() [5/8]

bool sysio::trace_api::operator== ( const block_trace_v2 & lhs,
const block_trace_v2 & rhs )

Definition at line 193 of file test_common.hpp.

193 {
194 return
195 lhs.id == rhs.id &&
196 lhs.number == rhs.number &&
197 lhs.previous_id == rhs.previous_id &&
198 lhs.timestamp == rhs.timestamp &&
199 lhs.producer == rhs.producer &&
201 lhs.action_mroot == rhs.action_mroot &&
203 lhs.transactions == rhs.transactions;
204 }
chain::block_id_type previous_id
Definition trace.hpp:79
std::variant< std::vector< transaction_trace_v2 >, std::vector< transaction_trace_v3 > > transactions
Definition trace.hpp:85
chain::checksum256_type action_mroot
Definition trace.hpp:83
chain::checksum256_type transaction_mroot
Definition trace.hpp:82
chain::block_id_type id
Definition trace.hpp:77
chain::block_timestamp_type timestamp
Definition trace.hpp:80

◆ operator==() [6/8]

bool sysio::trace_api::operator== ( const lib_entry_v0 & lhs,
const lib_entry_v0 & rhs )

Definition at line 227 of file test_common.hpp.

227 {
228 return
229 lhs.lib == rhs.lib;
230 }
uint32_t lib

◆ operator==() [7/8]

bool sysio::trace_api::operator== ( const transaction_trace_v0 & lhs,
const transaction_trace_v0 & rhs )

Definition at line 161 of file test_common.hpp.

161 {
162 return
163 lhs.id == rhs.id &&
164 lhs.actions == rhs.actions;
165 }
chain::transaction_id_type id
Definition trace.hpp:31
std::vector< action_trace_v0 > actions
Definition trace.hpp:32

◆ operator==() [8/8]

bool sysio::trace_api::operator== ( const transaction_trace_v2 & lhs,
const transaction_trace_v2 & rhs )

Definition at line 167 of file test_common.hpp.

167 {
168 return
169 lhs.id == rhs.id &&
170 lhs.actions == rhs.actions &&
171 lhs.status == rhs.status &&
172 lhs.cpu_usage_us == rhs.cpu_usage_us &&
173 lhs.net_usage_words == rhs.net_usage_words &&
174 lhs.signatures == rhs.signatures &&
181 }
fc::unsigned_int delay_sec
upper limit on the total CPU time billed for this transaction
uint16_t ref_block_num
specifies a block num in the last 2^16 blocks.
uint32_t ref_block_prefix
specifies the lower 32 bits of the blockid at get_ref_blocknum
uint8_t max_cpu_usage_ms
upper limit on total network bandwidth (in 8 byte words) billed for this transaction
time_point_sec expiration
the time at which a transaction expires
std::variant< std::vector< action_trace_v1 > > actions
Definition trace.hpp:46
std::vector< chain::signature_type > signatures
Definition trace.hpp:50
fc::enum_type< uint8_t, status_type > status
Definition trace.hpp:47
chain::transaction_id_type id
Definition trace.hpp:45
chain::transaction_header trx_header
Definition trace.hpp:51

◆ to_action_trace()

template<typename ActionTrace >
ActionTrace sysio::trace_api::to_action_trace ( const chain::action_trace & at)
inline

Definition at line 10 of file extract_util.hpp.

10 {
11 ActionTrace r;
12 r.receiver = at.receiver;
13 r.account = at.act.account;
14 r.action = at.act.name;
15 r.data = at.act.data;
16 if constexpr(std::is_same_v<ActionTrace, action_trace_v1>) {
17 r.return_value = at.return_value;
18 }
19 if( at.receipt ) {
20 r.global_sequence = at.receipt->global_sequence;
21 }
22 r.authorization.reserve( at.act.authorization.size());
23 for( const auto& auth : at.act.authorization ) {
24 r.authorization.emplace_back( authorization_trace_v0{auth.actor, auth.permission} );
25 }
26 return r;
27}
vector< permission_level > authorization
Definition action.hpp:59
std::vector< char > return_value
Definition trace.hpp:47
std::optional< action_receipt > receipt
Definition trace.hpp:34
Here is the caller graph for this function:

◆ to_transaction_trace()

template<typename TransactionTrace >
TransactionTrace sysio::trace_api::to_transaction_trace ( const cache_trace & t)
inline

Definition at line 30 of file extract_util.hpp.

30 {
31 TransactionTrace r;
32 if( !t.trace->failed_dtrx_trace ) {
33 r.id = t.trace->id;
34 } else {
35 r.id = t.trace->failed_dtrx_trace->id; // report the failed trx id since that is the id known to user
36 }
37 if constexpr(std::is_same_v<TransactionTrace, transaction_trace_v1> ||
38 std::is_same_v<TransactionTrace, transaction_trace_v2> ||
39 std::is_same_v<TransactionTrace, transaction_trace_v3>) {
40 if (t.trace->receipt) {
41 r.status = t.trace->receipt->status;
42 r.cpu_usage_us = t.trace->receipt->cpu_usage_us;
43 r.net_usage_words = t.trace->receipt->net_usage_words;
44 }
45 r.signatures = t.trx->get_signatures();
46 r.trx_header = static_cast<const chain::transaction_header&>( t.trx->get_transaction() );
47
48 r.block_num = t.trace->block_num;
49 r.block_time = t.trace->block_time;
50 r.producer_block_id = t.trace->producer_block_id;
51 }
52
53 using action_trace_t = std::conditional_t<std::is_same_v<TransactionTrace, transaction_trace_v2> ||
54 std::is_same_v<TransactionTrace, transaction_trace_v3>
55 , action_trace_v1, action_trace_v0>;
56 r.actions = std::vector<action_trace_t>();
57 std::get<std::vector<action_trace_t>>(r.actions).reserve( t.trace->action_traces.size());
58 for( const auto& at : t.trace->action_traces ) {
59 if( !at.context_free ) { // not including CFA at this time
60 std::get<std::vector<action_trace_t>>(r.actions).emplace_back( to_action_trace<action_trace_t>(at) );
61 }
62 }
63 return r;
64}
chain::packed_transaction_ptr trx
Definition trace.hpp:90
chain::transaction_trace_ptr trace
Definition trace.hpp:89
Here is the call graph for this function: