Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Release/2.1.x: Add additional contract to test_exhaustive_snapshot #9975

Merged
merged 1 commit into from
Feb 2, 2021
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
20 changes: 16 additions & 4 deletions unittests/snapshot_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,25 @@ void exhaustive_snapshot(const eosio::chain::backing_store_type main_store,
fc::temp_directory temp_dir;
tester chain(temp_dir, [main_store] (auto& config) { config.backing_store = main_store; }, true);

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 )
);

#warning add a snapshot2 account and send the action against it as well, so that we are actually walking through more than just one contract's data'

// 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("snapshot"_n, "increment"_n, "snapshot"_n, mutable_variant_object()
chain.push_action("snapshot1"_n, "increment"_n, "snapshot1"_n, mutable_variant_object()
( "value", 1 )
);

Expand All @@ -218,6 +227,9 @@ void exhaustive_snapshot(const eosio::chain::backing_store_type main_store,
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