239 {
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 } );
249
250 signal_applied_transaction(
252 { actt1 } ),
253 std::make_shared<packed_transaction>( ptrx1 ) );
254 signal_applied_transaction(
256 { actt2 } ),
257 std::make_shared<packed_transaction>( ptrx2 ) );
258 signal_applied_transaction(
260 { actt3 } ),
261 std::make_shared<packed_transaction>( ptrx3 ) );
262
263
265 { chain::packed_transaction(ptrx1), chain::packed_transaction(ptrx2), chain::packed_transaction(ptrx3) } );
266 signal_accepted_block( bsp1 );
267
268 const std::vector<action_trace_v1> expected_action_trace1 {
269 {
270 {
271 0,
272 "sysio.token"_n, "sysio.token"_n, "transfer"_n,
273 {{"alice"_n, "active"_n}},
275 },
276 {}
277 }
278 };
279
280 const std::vector<action_trace_v1> expected_action_trace2 {
281 {
282 {
283 1,
284 "bob"_n, "sysio.token"_n, "transfer"_n,
285 {{ "bob"_n, "active"_n }},
287 },
288 {}
289 }
290 };
291
292 const std::vector<action_trace_v1> expected_action_trace3 {
293 {
294 {
295 2,
296 "fred"_n, "sysio.token"_n, "transfer"_n,
297 {{ "fred"_n, "active"_n }},
299 },
300 {}
301 }
302 };
303
304 const std::vector<transaction_trace_v3> expected_transaction_traces {
305 {
306 {
307 ptrx1.id(),
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())
314 }
315 },
316 {
317 {
318 ptrx2.id(),
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())
325 }
326 },
327 {
328 {
329 ptrx3.id(),
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())
336 }
337 }
338 };
339
341 bsp1->id,
342 1,
343 bsp1->prev(),
344 chain::block_timestamp_type(1),
345 "bp.one"_n,
346 bsp1->block->transaction_mroot,
347 bsp1->block->action_mroot,
348 bsp1->block->schedule_version,
349 expected_transaction_traces
350 };
351
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);
356 }
auto make_block_state(chain::block_id_type previous, uint32_t height, uint32_t slot, chain::name producer, std::vector< chain::packed_transaction > trxs)
chain::bytes make_transfer_data(chain::name from, chain::name to, chain::asset quantity, std::string &&memo)