157 auto act1 = make_transfer_action(
"alice"_n,
"bob"_n,
"0.0001 SYS"_t,
"Memo!" );
158 auto act2 = make_transfer_action(
"alice"_n,
"bob"_n,
"0.0001 SYS"_t,
"Memo!" );
159 auto act3 = make_transfer_action(
"alice"_n,
"bob"_n,
"0.0001 SYS"_t,
"Memo!" );
160 auto actt1 = make_action_trace( 0, act1,
"sysio.token"_n );
161 auto actt2 = make_action_trace( 1, act2,
"alice"_n );
162 auto actt3 = make_action_trace( 2, act3,
"bob"_n );
163 auto ptrx1 = make_packed_trx( { act1, act2, act3 } );
166 signal_applied_transaction(
168 { actt1, actt2, actt3 } ),
169 std::make_shared<packed_transaction>(ptrx1) );
174 signal_accepted_block( bsp1 );
176 const std::vector<action_trace_v1> expected_action_traces {
180 "sysio.token"_n,
"sysio.token"_n,
"transfer"_n,
181 {{
"alice"_n,
"active"_n}},
189 "alice"_n,
"sysio.token"_n,
"transfer"_n,
190 {{
"alice"_n,
"active"_n}},
198 "bob"_n,
"sysio.token"_n,
"transfer"_n,
199 {{
"alice"_n,
"active"_n}},
209 expected_action_traces,
211 bsp1->block->transactions[0].cpu_usage_us,
212 bsp1->block->transactions[0].net_usage_words,
213 ptrx1.get_signatures(),
214 make_trx_header(ptrx1.get_transaction())
224 bsp1->block->transaction_mroot,
225 bsp1->block->action_mroot,
226 bsp1->block->schedule_version,
227 std::vector<transaction_trace_v3> {
228 expected_transaction_trace
232 BOOST_REQUIRE_EQUAL(max_lib, 0);
233 BOOST_REQUIRE(data_log.size() == 1);
234 BOOST_REQUIRE(std::holds_alternative<block_trace_v2>(data_log.at(0)));
235 BOOST_REQUIRE_EQUAL(std::get<block_trace_v2>(data_log.at(0)), expected_block_trace);
236 BOOST_REQUIRE_EQUAL(id_log.at(bsp1->block_num).size(), bsp1->block->transactions.size());
240 auto act1 = make_transfer_action(
"alice"_n,
"bob"_n,
"0.0001 SYS"_t,
"Memo!" );
241 auto act2 = make_transfer_action(
"bob"_n,
"alice"_n,
"0.0001 SYS"_t,
"Memo!" );
242 auto act3 = make_transfer_action(
"fred"_n,
"bob"_n,
"0.0001 SYS"_t,
"Memo!" );
243 auto actt1 = make_action_trace( 0, act1,
"sysio.token"_n );
244 auto actt2 = make_action_trace( 1, act2,
"bob"_n );
245 auto actt3 = make_action_trace( 2, act3,
"fred"_n );
246 auto ptrx1 = make_packed_trx( { act1 } );
247 auto ptrx2 = make_packed_trx( { act2 } );
248 auto ptrx3 = make_packed_trx( { act3 } );
250 signal_applied_transaction(
253 std::make_shared<packed_transaction>( ptrx1 ) );
254 signal_applied_transaction(
257 std::make_shared<packed_transaction>( ptrx2 ) );
258 signal_applied_transaction(
261 std::make_shared<packed_transaction>( ptrx3 ) );
266 signal_accepted_block( bsp1 );
268 const std::vector<action_trace_v1> expected_action_trace1 {
272 "sysio.token"_n,
"sysio.token"_n,
"transfer"_n,
273 {{
"alice"_n,
"active"_n}},
280 const std::vector<action_trace_v1> expected_action_trace2 {
284 "bob"_n,
"sysio.token"_n,
"transfer"_n,
285 {{
"bob"_n,
"active"_n }},
292 const std::vector<action_trace_v1> expected_action_trace3 {
296 "fred"_n,
"sysio.token"_n,
"transfer"_n,
297 {{
"fred"_n,
"active"_n }},
304 const std::vector<transaction_trace_v3> expected_transaction_traces {
308 expected_action_trace1,
310 bsp1->block->transactions[0].cpu_usage_us,
311 bsp1->block->transactions[0].net_usage_words,
312 ptrx1.get_signatures(),
313 make_trx_header(ptrx1.get_transaction())
319 expected_action_trace2,
321 bsp1->block->transactions[1].cpu_usage_us,
322 bsp1->block->transactions[1].net_usage_words,
323 ptrx2.get_signatures(),
324 make_trx_header(ptrx2.get_transaction())
330 expected_action_trace3,
332 bsp1->block->transactions[2].cpu_usage_us,
333 bsp1->block->transactions[2].net_usage_words,
334 ptrx3.get_signatures(),
335 make_trx_header(ptrx3.get_transaction())
346 bsp1->block->transaction_mroot,
347 bsp1->block->action_mroot,
348 bsp1->block->schedule_version,
349 expected_transaction_traces
352 BOOST_REQUIRE_EQUAL(max_lib, 0);
353 BOOST_REQUIRE(data_log.size() == 1);
354 BOOST_REQUIRE(std::holds_alternative<block_trace_v2>(data_log.at(0)));
355 BOOST_REQUIRE_EQUAL(std::get<block_trace_v2>(data_log.at(0)), expected_block_trace);
360 auto onerror_act = make_onerror_action(
"alice"_n, 1 );
361 auto actt1 = make_action_trace( 0, onerror_act,
"sysio.token"_n );
362 auto ptrx1 = make_packed_trx( { onerror_act } );
364 auto act2 = make_transfer_action(
"bob"_n,
"alice"_n,
"0.0001 SYS"_t,
"Memo!" );
365 auto actt2 = make_action_trace( 1, act2,
"bob"_n );
366 auto transfer_trx = make_packed_trx( { act2 } );
372 onerror_trace->failed_dtrx_trace = transfer_trace;
374 signal_applied_transaction( onerror_trace, std::make_shared<packed_transaction>( transfer_trx ) );
378 signal_accepted_block( bsp1 );
380 const std::vector<action_trace_v1> expected_action_trace {
384 "sysio.token"_n,
"sysio"_n,
"onerror"_n,
385 {{
"alice"_n,
"active"_n }},
392 const std::vector<transaction_trace_v3> expected_transaction_traces {
396 expected_action_trace,
398 bsp1->block->transactions[0].cpu_usage_us,
399 bsp1->block->transactions[0].net_usage_words,
400 transfer_trx.get_signatures(),
401 make_trx_header(transfer_trx.get_transaction())
412 bsp1->block->transaction_mroot,
413 bsp1->block->action_mroot,
414 bsp1->block->schedule_version,
415 expected_transaction_traces
418 BOOST_REQUIRE_EQUAL(max_lib, 0);
419 BOOST_REQUIRE(data_log.size() == 1);
420 BOOST_REQUIRE(std::holds_alternative<block_trace_v2>(data_log.at(0)));
421 BOOST_REQUIRE_EQUAL(std::get<block_trace_v2>(data_log.at(0)), expected_block_trace);
std::vector< chain::transaction_id_type > ids