Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] Add a second account and action to test_exhaustive_snapshot #510

Merged
merged 3 commits into from
Jun 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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