Skip to content

Commit

Permalink
Merge branch 'main' into fix_get_table_rows_by_seckey
Browse files Browse the repository at this point in the history
  • Loading branch information
linh2931 authored Jun 26, 2022
2 parents 6e8835a + be7680b commit 1f1754b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion unittests/snapshot_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,30 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_exhaustive_snapshot, SNAPSHOT_SUITE, snapshot
{
tester chain;

chain.create_account("snapshot"_n);
// Create 2 accounts
chain.create_accounts({"snapshot"_n, "snapshot1"_n});

// Set code and increment the first account
chain.produce_blocks(1);
chain.set_code("snapshot"_n, contracts::snapshot_test_wasm());
chain.set_abi("snapshot"_n, contracts::snapshot_test_abi().data());
chain.produce_blocks(1);
chain.push_action("snapshot"_n, "increment"_n, "snapshot"_n, mutable_variant_object()
( "value", 1 )
);

// Set code and increment the second account
chain.produce_blocks(1);
chain.set_code("snapshot1"_n, contracts::snapshot_test_wasm());
chain.set_abi("snapshot1"_n, contracts::snapshot_test_abi().data());
chain.produce_blocks(1);
// increment the test contract
chain.push_action("snapshot1"_n, "increment"_n, "snapshot1"_n, mutable_variant_object()
( "value", 1 )
);

chain.produce_blocks(1);

chain.control->abort_block();

static const int generation_count = 8;
Expand All @@ -204,6 +223,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_exhaustive_snapshot, SNAPSHOT_SUITE, snapshot
chain.push_action("snapshot"_n, "increment"_n, "snapshot"_n, mutable_variant_object()
( "value", 1 )
);
chain.push_action("snapshot1"_n, "increment"_n, "snapshot1"_n, mutable_variant_object()
( "value", 1 )
);

// produce block
auto new_block = chain.produce_block();
Expand Down

0 comments on commit 1f1754b

Please sign in to comment.