diff --git a/.cicd/defaults.json b/.cicd/defaults.json index a871f25db9..6299fae25a 100644 --- a/.cicd/defaults.json +++ b/.cicd/defaults.json @@ -4,6 +4,6 @@ "prerelease":true }, "referencecontracts":{ - "ref":"main" + "ref":"fix_failures_by_default_tester" } } diff --git a/libraries/testing/include/eosio/testing/tester.hpp b/libraries/testing/include/eosio/testing/tester.hpp index 3ef0d1ced1..3e4a370548 100644 --- a/libraries/testing/include/eosio/testing/tester.hpp +++ b/libraries/testing/include/eosio/testing/tester.hpp @@ -67,6 +67,7 @@ namespace eosio::testing { preactivate_feature_and_new_bios, old_wasm_parser, full_except_do_not_disable_deferred_trx, + full_except_do_not_transition_to_savanna, full }; @@ -542,7 +543,6 @@ namespace eosio::testing { vector protocol_features_to_be_activated_wo_preactivation; signed_block_ptr lib_block; // updated via irreversible_block signal block_id_type lib_id; // updated via irreversible_block signal - bool is_savanna{false}; private: std::vector get_all_builtin_protocol_features(); @@ -551,13 +551,11 @@ namespace eosio::testing { class tester : public base_tester { public: - tester(setup_policy policy = setup_policy::full, db_read_mode read_mode = db_read_mode::HEAD, std::optional genesis_max_inline_action_size = std::optional{}, bool is_savanna = false) { - this->is_savanna = is_savanna; + tester(setup_policy policy = setup_policy::full, db_read_mode read_mode = db_read_mode::HEAD, std::optional genesis_max_inline_action_size = std::optional{}) { init(policy, read_mode, genesis_max_inline_action_size); } - tester(controller::config config, const genesis_state& genesis, bool is_savanna = false) { - this->is_savanna = is_savanna; + tester(controller::config config, const genesis_state& genesis) { init(std::move(config), genesis); } @@ -569,8 +567,7 @@ namespace eosio::testing { init(std::move(config), std::move(pfs), genesis); } - tester(const fc::temp_directory& tempdir, bool use_genesis, bool is_savanna = false) { - this->is_savanna = is_savanna; + tester(const fc::temp_directory& tempdir, bool use_genesis) { auto def_conf = default_config(tempdir); cfg = def_conf.first; @@ -583,8 +580,7 @@ namespace eosio::testing { } template - tester(const fc::temp_directory& tempdir, Lambda conf_edit, bool use_genesis, bool is_savanna = false) { - this->is_savanna = is_savanna; + tester(const fc::temp_directory& tempdir, Lambda conf_edit, bool use_genesis) { auto def_conf = default_config(tempdir); cfg = def_conf.first; conf_edit(cfg); @@ -623,19 +619,40 @@ namespace eosio::testing { }; - class savanna_tester : public tester { + // The behavior of legacy_tester is activating all the protocol features but not + // transition to Savanna consensus. + // If needed, the tester can be transitioned to Savanna by explicitly calling + // set_finalizer host function only. + class legacy_tester : public tester { public: - savanna_tester(setup_policy policy = setup_policy::full, db_read_mode read_mode = db_read_mode::HEAD, std::optional genesis_max_inline_action_size = std::optional{}); - savanna_tester(controller::config config, const genesis_state& genesis); - savanna_tester(const fc::temp_directory& tempdir, bool use_genesis); + legacy_tester(setup_policy policy = setup_policy::full_except_do_not_transition_to_savanna, db_read_mode read_mode = db_read_mode::HEAD, std::optional genesis_max_inline_action_size = std::optional{}) + : tester(policy == setup_policy::full ? setup_policy::full_except_do_not_transition_to_savanna + : policy, + read_mode, genesis_max_inline_action_size) {}; + + legacy_tester(controller::config config, const genesis_state& genesis) + : tester(config, genesis) {}; + + legacy_tester(const fc::temp_directory& tempdir, bool use_genesis) + : tester(tempdir, use_genesis) {}; template - savanna_tester(const fc::temp_directory& tempdir, Lambda conf_edit, bool use_genesis) - : tester(tempdir, conf_edit, use_genesis, true) { // true for is_savanna - } + legacy_tester(const fc::temp_directory& tempdir, Lambda conf_edit, bool use_genesis) + : tester(tempdir, conf_edit, use_genesis) {}; + + legacy_tester(const std::function& control_setup, setup_policy policy = setup_policy::full, db_read_mode read_mode = db_read_mode::HEAD) + : tester(control_setup, + policy == setup_policy::full ? setup_policy::full_except_do_not_transition_to_savanna + : policy, + read_mode) {}; + + // setup_policy::full does not not transition to Savanna consensus. + void execute_setup_policy(const setup_policy policy) { + tester::execute_setup_policy(policy == setup_policy::full ? setup_policy::full_except_do_not_transition_to_savanna : policy); + }; }; - using legacy_tester = tester; + using savanna_tester = tester; using testers = boost::mpl::list; class tester_no_disable_deferred_trx : public tester { @@ -662,9 +679,7 @@ namespace eosio::testing { } controller::config vcfg; - validating_tester(const flat_set& trusted_producers = flat_set(), deep_mind_handler* dmlog = nullptr, setup_policy p = setup_policy::full, bool is_savanna = false) { - this->is_savanna = is_savanna; - + validating_tester(const flat_set& trusted_producers = flat_set(), deep_mind_handler* dmlog = nullptr, setup_policy p = setup_policy::full) { auto def_conf = default_config(tempdir); vcfg = def_conf.first; @@ -704,8 +719,7 @@ namespace eosio::testing { } template - validating_tester(const fc::temp_directory& tempdir, Lambda conf_edit, bool use_genesis, bool is_savanna = false) { - this->is_savanna = false; + validating_tester(const fc::temp_directory& tempdir, Lambda conf_edit, bool use_genesis) { auto def_conf = default_config(tempdir); conf_edit(def_conf.first); vcfg = def_conf.first; @@ -780,17 +794,24 @@ namespace eosio::testing { } }; - class savanna_validating_tester : public validating_tester { + // The behavior of legacy_validating_tester is activating all the protocol features + // but not transition to Savanna consensus. + // If needed, the tester can be transitioned to Savanna by explicitly calling + // set_finalizer host function only. + class legacy_validating_tester : public validating_tester { public: - savanna_validating_tester(const flat_set& trusted_producers = flat_set(), deep_mind_handler* dmlog = nullptr, setup_policy p = setup_policy::full); + legacy_validating_tester(const flat_set& trusted_producers = flat_set(), deep_mind_handler* dmlog = nullptr, setup_policy p = setup_policy::full_except_do_not_transition_to_savanna) + : validating_tester(trusted_producers, dmlog, p == setup_policy::full ? setup_policy::full_except_do_not_transition_to_savanna : p) {}; + + legacy_validating_tester(const fc::temp_directory& tempdir, bool use_genesis) + : validating_tester(tempdir, use_genesis) {}; template - savanna_validating_tester(const fc::temp_directory& tempdir, Lambda conf_edit, bool use_genesis) - : validating_tester(tempdir, conf_edit, use_genesis, true) { // true for is_savanna - } + legacy_validating_tester(const fc::temp_directory& tempdir, Lambda conf_edit, bool use_genesis) + : validating_tester(tempdir, conf_edit, use_genesis) {}; }; - using legacy_validating_tester = validating_tester; + using savanna_validating_tester = validating_tester; using validating_testers = boost::mpl::list; // ------------------------------------------------------------------------------------- diff --git a/libraries/testing/tester.cpp b/libraries/testing/tester.cpp index 491dccff48..655a8bd3e7 100644 --- a/libraries/testing/tester.cpp +++ b/libraries/testing/tester.cpp @@ -274,21 +274,26 @@ namespace eosio::testing { break; } case setup_policy::full: + case setup_policy::full_except_do_not_transition_to_savanna: case setup_policy::full_except_do_not_disable_deferred_trx: { schedule_preactivate_protocol_feature(); produce_block(); set_before_producer_authority_bios_contract(); - if( policy == setup_policy::full ) { - preactivate_all_builtin_protocol_features(); - } else { + if( policy == setup_policy::full_except_do_not_disable_deferred_trx ) { preactivate_all_but_disable_deferred_trx(); + } else { + preactivate_all_builtin_protocol_features(); } produce_block(); set_bios_contract(); - if( is_savanna ) { + + // Do not transition to Savanna under full_except_do_not_transition_to_savanna or + // full_except_do_not_disable_deferred_trx + if( policy == setup_policy::full ) { finalizer_keys fin_keys(*this, 4u /* num_keys */, 4u /* finset_size */); fin_keys.activate_savanna(0u /* first_key_idx */); } + break; } case setup_policy::none: @@ -1400,18 +1405,6 @@ namespace eosio::testing { execute_setup_policy(policy); } - savanna_tester::savanna_tester(setup_policy policy, db_read_mode read_mode, std::optional genesis_max_inline_action_size) - : tester(policy, read_mode, genesis_max_inline_action_size, true) { // true for is_savanna - } - - savanna_tester::savanna_tester(controller::config config, const genesis_state& genesis) - : tester(config, genesis, true) { // true for is_savanna - } - - savanna_tester::savanna_tester(const fc::temp_directory& tempdir, bool use_genesis) - : tester(tempdir, use_genesis, true) { // true for is_savanna - } - unique_ptr validating_tester::create_validating_node(controller::config vcfg, const genesis_state& genesis, bool use_genesis, deep_mind_handler* dmlog) { unique_ptr validating_node = std::make_unique(vcfg, make_protocol_feature_set(), genesis.compute_chain_id()); validating_node->add_indices(); @@ -1429,10 +1422,6 @@ namespace eosio::testing { return validating_node; } - savanna_validating_tester::savanna_validating_tester(const flat_set& trusted_producers, deep_mind_handler* dmlog, setup_policy p) - : validating_tester(trusted_producers, dmlog, p, true) { // true for is_savanna - } - bool fc_exception_message_is::operator()( const fc::exception& ex ) { auto message = ex.get_log().at( 0 ).get_message(); bool match = (message == expected); diff --git a/tests/test_snapshot_information.cpp b/tests/test_snapshot_information.cpp index 49aa25c431..0e5b1a5c74 100644 --- a/tests/test_snapshot_information.cpp +++ b/tests/test_snapshot_information.cpp @@ -20,8 +20,9 @@ BOOST_AUTO_TEST_SUITE(producer_snapshot_tests) using next_t = pending_snapshot::next_t; -BOOST_AUTO_TEST_CASE_TEMPLATE(test_snapshot_information, SNAPSHOT_SUITE, snapshot_suites) { - tester chain; +template +void test_snapshot_information() { + TESTER chain; const std::filesystem::path parent_path = chain.get_config().blocks_dir.parent_path(); chain.create_account("snapshot"_n); @@ -31,12 +32,14 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_snapshot_information, SNAPSHOT_SUITE, snapsho chain.produce_blocks(1); auto block = chain.produce_block(); - BOOST_REQUIRE_EQUAL(block->block_num(), 6u); // ensure that test setup stays consistent with original snapshot setup + const uint32_t base_block_num = block->block_num(); + // undo the auto-pending from tester chain.control->abort_block(); auto block2 = chain.produce_block(); - BOOST_REQUIRE_EQUAL(block2->block_num(), 7u); // ensure that test setup stays consistent with original snapshot setup + BOOST_REQUIRE_EQUAL(block2->block_num(), base_block_num + 1); // ensure that test setup stays consistent with original snapshot setup + // undo the auto-pending from tester chain.control->abort_block(); @@ -61,8 +64,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_snapshot_information, SNAPSHOT_SUITE, snapsho next_t next; pending_snapshot pending{ block2->previous, next, pending_path.generic_string(), final_path.generic_string() }; test_snap_info = pending.finalize(*chain.control); - BOOST_REQUIRE_EQUAL(test_snap_info.head_block_num, 6u); + BOOST_REQUIRE_EQUAL(test_snap_info.head_block_num, base_block_num); BOOST_REQUIRE_EQUAL(test_snap_info.version, chain_snapshot_header::current_version); } +BOOST_AUTO_TEST_CASE_TEMPLATE(snapshot_information_test, SNAPSHOT_SUITE, snapshot_suites) { + test_snapshot_information(); + test_snapshot_information(); +} + BOOST_AUTO_TEST_SUITE_END() diff --git a/unittests/chain_tests.cpp b/unittests/chain_tests.cpp index fea86efa53..fbf86f8cdf 100644 --- a/unittests/chain_tests.cpp +++ b/unittests/chain_tests.cpp @@ -16,7 +16,7 @@ using namespace eosio::testing; BOOST_AUTO_TEST_SUITE(chain_tests) BOOST_AUTO_TEST_CASE( replace_producer_keys ) try { - validating_tester tester; + legacy_validating_tester tester; const auto new_key = get_public_key(name("newkey"), config::active_name.to_string()); diff --git a/unittests/eosio_system_tester.hpp b/unittests/eosio_system_tester.hpp index 2fc5675fa4..f7f7422184 100644 --- a/unittests/eosio_system_tester.hpp +++ b/unittests/eosio_system_tester.hpp @@ -16,7 +16,7 @@ using mvo = fc::mutable_variant_object; namespace eosio_system { -template +template class eosio_system_tester : public T { public: diff --git a/unittests/finality_test_cluster.hpp b/unittests/finality_test_cluster.hpp index ac78c915c2..4702dc2f1c 100644 --- a/unittests/finality_test_cluster.hpp +++ b/unittests/finality_test_cluster.hpp @@ -28,7 +28,7 @@ struct finality_node_t : public eosio::testing::tester { eosio::testing::finalizer_keys finkeys; size_t cur_key{0}; // index of key used in current policy - finality_node_t() : finkeys(*this) {} + finality_node_t() : eosio::testing::tester(eosio::testing::setup_policy::full_except_do_not_transition_to_savanna), finkeys(*this) {} size_t last_vote_index() const { assert(!votes.empty()); diff --git a/unittests/finality_tests.cpp b/unittests/finality_tests.cpp index 71c5f65338..28f9cc688d 100644 --- a/unittests/finality_tests.cpp +++ b/unittests/finality_tests.cpp @@ -10,7 +10,8 @@ BOOST_AUTO_TEST_SUITE(finality_tests) // test set_finalizer host function serialization and tester set_finalizers BOOST_AUTO_TEST_CASE(initial_set_finalizer_test) { try { - validating_tester t; + // Do not transition to Savanna at constrution. Transition explicitly later. + legacy_validating_tester t; // Create finalizer keys constexpr size_t num_finalizers = 21; @@ -60,7 +61,8 @@ BOOST_AUTO_TEST_CASE(initial_set_finalizer_test) { try { void test_finality_transition(const vector& accounts, const base_tester::finalizer_policy_input& input, bool lib_advancing_expected) { - validating_tester t; + // Do not transition to Savanna at constrution. Transition explicitly later. + legacy_validating_tester t; t.produce_block(); diff --git a/unittests/finalizer_update_tests.cpp b/unittests/finalizer_update_tests.cpp index db71dfa21c..cb6dffa1fd 100644 --- a/unittests/finalizer_update_tests.cpp +++ b/unittests/finalizer_update_tests.cpp @@ -31,7 +31,8 @@ static void ensure_next_block_finalizer_policy(validating_tester& t, // to take effect. // --------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(savanna_set_finalizer_single_test) { try { - validating_tester t; + // Do not transition to Savanna at constrution. Transition explicitly later. + legacy_validating_tester t; size_t num_keys = 22u; size_t finset_size = 21u; @@ -67,7 +68,8 @@ BOOST_AUTO_TEST_CASE(savanna_set_finalizer_single_test) { try { // at the same time. // --------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(savanna_set_finalizer_multiple_test) { try { - validating_tester t; + // Do not transition to Savanna at constrution. Transition explicitly later. + legacy_validating_tester t; size_t num_keys = 50u; size_t finset_size = 21u; diff --git a/unittests/forked_tests.cpp b/unittests/forked_tests.cpp index ce4c83c2be..4323d1f289 100644 --- a/unittests/forked_tests.cpp +++ b/unittests/forked_tests.cpp @@ -15,10 +15,12 @@ using namespace eosio::chain; using namespace eosio::testing; +// Tests in this file are for Legacy only. Savanna forked tests will be done +// by https://github.com/AntelopeIO/spring/issues/196 BOOST_AUTO_TEST_SUITE(forked_tests) BOOST_AUTO_TEST_CASE( irrblock ) try { - tester c; + legacy_tester c; c.produce_blocks(10); auto r = c.create_accounts( {"dan"_n,"sam"_n,"pam"_n,"scott"_n} ); auto res = c.set_producers( {"dan"_n,"sam"_n,"pam"_n,"scott"_n} ); @@ -34,7 +36,7 @@ struct fork_tracker { }; BOOST_AUTO_TEST_CASE( fork_with_bad_block ) try { - tester bios; + legacy_tester bios; bios.produce_block(); bios.produce_block(); bios.create_accounts( {"a"_n,"b"_n,"c"_n,"d"_n,"e"_n} ); @@ -46,7 +48,7 @@ BOOST_AUTO_TEST_CASE( fork_with_bad_block ) try { BOOST_REQUIRE( produce_until_transition( bios, "e"_n, "a"_n ) ); // sync remote node - tester remote(setup_policy::none); + legacy_tester remote(setup_policy::none); push_blocks(bios, remote); // produce 6 blocks on bios @@ -125,7 +127,7 @@ BOOST_AUTO_TEST_CASE( fork_with_bad_block ) try { } FC_LOG_AND_RETHROW(); BOOST_AUTO_TEST_CASE( forking ) try { - tester c; + legacy_tester c; while (c.control->head_block_num() < 3) { c.produce_block(); } @@ -164,7 +166,7 @@ BOOST_AUTO_TEST_CASE( forking ) try { ); - tester c2(setup_policy::none); + legacy_tester c2(setup_policy::none); wlog( "push c1 blocks to c2" ); push_blocks(c, c2); wlog( "end push c1 blocks to c2" ); @@ -279,7 +281,7 @@ BOOST_AUTO_TEST_CASE( forking ) try { * the highest last irreversible block over one that is longer. */ BOOST_AUTO_TEST_CASE( prune_remove_branch ) try { - tester c; + legacy_tester c; while (c.control->head_block_num() < 11) { c.produce_block(); } @@ -288,7 +290,7 @@ BOOST_AUTO_TEST_CASE( prune_remove_branch ) try { wlog("set producer schedule to [dan,sam,pam,scott]"); c.produce_blocks(50); - tester c2(setup_policy::none); + legacy_tester c2(setup_policy::none); wlog( "push c1 blocks to c2" ); push_blocks(c, c2); @@ -298,7 +300,7 @@ BOOST_AUTO_TEST_CASE( prune_remove_branch ) try { uint32_t fork_num = c.control->head_block_num(); - auto nextproducer = [](tester &c, int skip_interval) ->account_name { + auto nextproducer = [](legacy_tester &c, int skip_interval) ->account_name { auto head_time = c.control->head_block_time(); auto next_time = head_time + fc::milliseconds(config::block_interval_ms * skip_interval); return c.control->active_producers().get_scheduled_producer(next_time).producer_name; @@ -341,9 +343,9 @@ BOOST_AUTO_TEST_CASE( prune_remove_branch ) try { */ BOOST_AUTO_TEST_CASE( validator_accepts_valid_blocks ) try { - tester n1(setup_policy::none); - tester n2(setup_policy::none); - tester n3(setup_policy::none); + legacy_tester n1(setup_policy::none); + legacy_tester n2(setup_policy::none); + legacy_tester n3(setup_policy::none); n1.produce_block(); @@ -379,7 +381,7 @@ BOOST_AUTO_TEST_CASE( validator_accepts_valid_blocks ) try { } FC_LOG_AND_RETHROW() BOOST_AUTO_TEST_CASE( read_modes ) try { - tester c; + legacy_tester c; c.produce_block(); c.produce_block(); auto r = c.create_accounts( {"dan"_n,"sam"_n,"pam"_n} ); @@ -389,12 +391,12 @@ BOOST_AUTO_TEST_CASE( read_modes ) try { auto head_block_num = c.control->head_block_num(); auto last_irreversible_block_num = c.control->last_irreversible_block_num(); - tester head(setup_policy::none, db_read_mode::HEAD); + legacy_tester head(setup_policy::none, db_read_mode::HEAD); push_blocks(c, head); BOOST_CHECK_EQUAL(head_block_num, head.control->fork_db_head_block_num()); BOOST_CHECK_EQUAL(head_block_num, head.control->head_block_num()); - tester irreversible(setup_policy::none, db_read_mode::IRREVERSIBLE); + legacy_tester irreversible(setup_policy::none, db_read_mode::IRREVERSIBLE); push_blocks(c, irreversible); BOOST_CHECK_EQUAL(head_block_num, irreversible.control->fork_db_head_block_num()); BOOST_CHECK_EQUAL(last_irreversible_block_num, irreversible.control->head_block_num()); @@ -408,7 +410,7 @@ BOOST_AUTO_TEST_CASE( irreversible_mode ) try { return (db.find( n ) != nullptr); }; - tester main; + legacy_tester main; main.create_accounts( {"producer1"_n, "producer2"_n} ); main.produce_block(); @@ -428,7 +430,7 @@ BOOST_AUTO_TEST_CASE( irreversible_mode ) try { BOOST_REQUIRE( lib2 < hbn1 ); - tester other(setup_policy::none); + legacy_tester other(setup_policy::none); push_blocks( main, other ); BOOST_CHECK_EQUAL( other.control->head_block_num(), hbn2 ); @@ -467,7 +469,7 @@ BOOST_AUTO_TEST_CASE( irreversible_mode ) try { BOOST_REQUIRE( hbn4 > hbn3 ); BOOST_REQUIRE( lib4 < hbn1 ); - tester irreversible(setup_policy::none, db_read_mode::IRREVERSIBLE); + legacy_tester irreversible(setup_policy::none, db_read_mode::IRREVERSIBLE); push_blocks( main, irreversible, hbn1 ); @@ -514,7 +516,7 @@ BOOST_AUTO_TEST_CASE( irreversible_mode ) try { } FC_LOG_AND_RETHROW() BOOST_AUTO_TEST_CASE( reopen_forkdb ) try { - tester c1; + legacy_tester c1; c1.create_accounts( {"alice"_n,"bob"_n,"carol"_n} ); c1.produce_block(); @@ -529,7 +531,7 @@ BOOST_AUTO_TEST_CASE( reopen_forkdb ) try { c1.produce_block(); produce_until_transition( c1, "carol"_n, "alice"_n ); - tester c2(setup_policy::none); + legacy_tester c2(setup_policy::none); push_blocks( c1, c2 ); @@ -568,7 +570,7 @@ BOOST_AUTO_TEST_CASE( reopen_forkdb ) try { } FC_LOG_AND_RETHROW() BOOST_AUTO_TEST_CASE( push_block_returns_forked_transactions ) try { - tester c1; + legacy_tester c1; while (c1.control->head_block_num() < 3) { c1.produce_block(); } @@ -578,7 +580,7 @@ BOOST_AUTO_TEST_CASE( push_block_returns_forked_transactions ) try { wlog("set producer schedule to [dan,sam,pam]"); c1.produce_blocks(40); - tester c2(setup_policy::none); + legacy_tester c2(setup_policy::none); wlog( "push c1 blocks to c2" ); push_blocks(c1, c2); diff --git a/unittests/producer_schedule_if_tests.cpp b/unittests/producer_schedule_if_tests.cpp index 1252b3014e..8c6b6d55ad 100644 --- a/unittests/producer_schedule_if_tests.cpp +++ b/unittests/producer_schedule_if_tests.cpp @@ -20,7 +20,8 @@ inline account_name get_expected_producer(const vector& sche } // anonymous namespace -BOOST_FIXTURE_TEST_CASE( verify_producer_schedule_after_instant_finality_activation, validating_tester ) try { +// Use legacy_validating_tester because it transitions to savanna as part of the test. +BOOST_FIXTURE_TEST_CASE( verify_producer_schedule_after_instant_finality_activation, legacy_validating_tester ) try { // Utility function to ensure that producer schedule work as expected const auto& confirm_schedule_correctness = [&](const vector& new_prod_schd, uint32_t expected_schd_ver, uint32_t expected_block_num = 0) { @@ -120,7 +121,7 @@ bool compare_schedules( const vector& a, const producer_auth return std::equal( a.begin(), a.end(), b.producers.begin(), b.producers.end() ); }; -BOOST_FIXTURE_TEST_CASE( proposer_policy_progression_test, validating_tester ) try { +BOOST_FIXTURE_TEST_CASE( proposer_policy_progression_test, legacy_validating_tester ) try { create_accounts( {"alice"_n,"bob"_n,"carol"_n} ); // set_producers in same block, do it the explicit way to use a diff expiration and avoid duplicate trx @@ -367,7 +368,7 @@ BOOST_FIXTURE_TEST_CASE( proposer_policy_progression_test, validating_tester ) t } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( proposer_policy_misc_tests, validating_tester ) try { +BOOST_FIXTURE_TEST_CASE( proposer_policy_misc_tests, legacy_validating_tester ) try { create_accounts( {"alice"_n,"bob"_n} ); while (control->head_block_num() < 3) { @@ -399,7 +400,7 @@ BOOST_FIXTURE_TEST_CASE( proposer_policy_misc_tests, validating_tester ) try { } FC_LOG_AND_RETHROW() BOOST_AUTO_TEST_CASE( switch_producers_test ) try { - validating_tester chain; + legacy_validating_tester chain; const std::vector accounts = { "aliceaccount"_n, "bobbyaccount"_n, "carolaccount"_n, "emilyaccount"_n }; chain.create_accounts( accounts ); diff --git a/unittests/producer_schedule_tests.cpp b/unittests/producer_schedule_tests.cpp index ce8d7ec5c0..ef6b374e17 100644 --- a/unittests/producer_schedule_tests.cpp +++ b/unittests/producer_schedule_tests.cpp @@ -22,7 +22,7 @@ account_name get_expected_producer(const vector& schedule, b } // anonymous namespace -BOOST_FIXTURE_TEST_CASE( verify_producer_schedule, validating_tester ) try { +BOOST_FIXTURE_TEST_CASE( verify_producer_schedule, legacy_validating_tester ) try { // Utility function to ensure that producer schedule work as expected const auto& confirm_schedule_correctness = [&](const vector& new_prod_schd, uint32_t expected_schd_ver) { @@ -108,19 +108,20 @@ BOOST_FIXTURE_TEST_CASE( verify_producer_schedule, validating_tester ) try { } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( verify_producers, validating_tester ) try { +BOOST_AUTO_TEST_CASE_TEMPLATE(verify_producers, T, validating_testers) try { + T chain; vector valid_producers = { "inita"_n, "initb"_n, "initc"_n, "initd"_n, "inite"_n, "initf"_n, "initg"_n, "inith"_n, "initi"_n, "initj"_n, "initk"_n, "initl"_n, "initm"_n, "initn"_n, "inito"_n, "initp"_n, "initq"_n, "initr"_n, "inits"_n, "initt"_n, "initu"_n }; - create_accounts(valid_producers); - set_producers(valid_producers); + chain.create_accounts(valid_producers); + chain.set_producers(valid_producers); // account initz does not exist vector nonexisting_producer = { "initz"_n }; - BOOST_CHECK_THROW(set_producers(nonexisting_producer), wasm_execution_error); + BOOST_CHECK_THROW(chain.set_producers(nonexisting_producer), wasm_execution_error); // replace initg with inita, inita is now duplicate vector invalid_producers = { @@ -129,11 +130,11 @@ BOOST_FIXTURE_TEST_CASE( verify_producers, validating_tester ) try { "inito"_n, "initp"_n, "initq"_n, "initr"_n, "inits"_n, "initt"_n, "initu"_n }; - BOOST_CHECK_THROW(set_producers(invalid_producers), wasm_execution_error); + BOOST_CHECK_THROW(chain.set_producers(invalid_producers), wasm_execution_error); } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( producer_schedule_promotion_test, validating_tester ) try { +BOOST_FIXTURE_TEST_CASE( producer_schedule_promotion_test, legacy_validating_tester ) try { create_accounts( {"alice"_n,"bob"_n,"carol"_n} ); while (control->head_block_num() < 3) { produce_block(); @@ -200,7 +201,7 @@ BOOST_FIXTURE_TEST_CASE( producer_schedule_promotion_test, validating_tester ) t BOOST_REQUIRE_EQUAL( validate(), true ); } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( producer_schedule_reduction, tester ) try { +BOOST_FIXTURE_TEST_CASE( producer_schedule_reduction, legacy_tester ) try { create_accounts( {"alice"_n,"bob"_n,"carol"_n} ); while (control->head_block_num() < 3) { produce_block(); @@ -261,9 +262,9 @@ BOOST_FIXTURE_TEST_CASE( producer_schedule_reduction, tester ) try { BOOST_REQUIRE_EQUAL( validate(), true ); } FC_LOG_AND_RETHROW() -BOOST_AUTO_TEST_CASE( empty_producer_schedule_has_no_effect ) try { +BOOST_AUTO_TEST_CASE_TEMPLATE(empty_producer_schedule_has_no_effect, T, validating_testers) try { fc::temp_directory tempdir; - validating_tester c( tempdir, true ); + T c( tempdir, true ); c.execute_setup_policy( setup_policy::preactivate_feature_and_new_bios ); c.create_accounts( {"alice"_n,"bob"_n,"carol"_n} ); @@ -379,7 +380,7 @@ BOOST_AUTO_TEST_CASE( switch_producers_test ) try { } FC_LOG_AND_RETHROW() BOOST_AUTO_TEST_CASE( producer_watermark_test ) try { - tester c; + legacy_tester c; c.create_accounts( {"alice"_n,"bob"_n,"carol"_n} ); c.produce_block(); @@ -500,27 +501,31 @@ BOOST_AUTO_TEST_CASE( producer_watermark_test ) try { } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( producer_one_of_n_test, validating_tester ) try { - create_accounts( {"alice"_n,"bob"_n} ); - produce_block(); +BOOST_AUTO_TEST_CASE_TEMPLATE(producer_one_of_n_test, T, validating_testers) try { + T chain; + + chain.create_accounts( {"alice"_n,"bob"_n} ); + chain.produce_block(); vector sch1 = { producer_authority{"alice"_n, block_signing_authority_v0{1, {{get_public_key("alice"_n, "bs1"), 1}, {get_public_key("alice"_n, "bs2"), 1}}}}, producer_authority{"bob"_n, block_signing_authority_v0{1, {{get_public_key("bob"_n, "bs1"), 1}, {get_public_key("bob"_n, "bs2"), 1}}}} }; - auto res = set_producer_schedule( sch1 ); - block_signing_private_keys.emplace(get_public_key("alice"_n, "bs1"), get_private_key("alice"_n, "bs1")); - block_signing_private_keys.emplace(get_public_key("bob"_n, "bs1"), get_private_key("bob"_n, "bs1")); + auto res = chain.set_producer_schedule( sch1 ); + chain.block_signing_private_keys.emplace(get_public_key("alice"_n, "bs1"), get_private_key("alice"_n, "bs1")); + chain.block_signing_private_keys.emplace(get_public_key("bob"_n, "bs1"), get_private_key("bob"_n, "bs1")); - BOOST_REQUIRE(produce_until_blocks_from(*this, {"alice"_n, "bob"_n}, 300)); + BOOST_REQUIRE(produce_until_blocks_from(chain, {"alice"_n, "bob"_n}, 300)); - BOOST_REQUIRE_EQUAL( validate(), true ); + BOOST_REQUIRE_EQUAL( chain.validate(), true ); } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( producer_m_of_n_test, validating_tester ) try { - create_accounts( {"alice"_n,"bob"_n} ); - produce_block(); +BOOST_AUTO_TEST_CASE_TEMPLATE(producer_m_of_n_test, T, validating_testers) try { + T chain; + + chain.create_accounts( {"alice"_n,"bob"_n} ); + chain.produce_block(); vector sch1 = { @@ -528,20 +533,21 @@ BOOST_FIXTURE_TEST_CASE( producer_m_of_n_test, validating_tester ) try { producer_authority{"bob"_n, block_signing_authority_v0{2, {{get_public_key("bob"_n, "bs1"), 1}, {get_public_key("bob"_n, "bs2"), 1}}}} }; - auto res = set_producer_schedule( sch1 ); - block_signing_private_keys.emplace(get_public_key("alice"_n, "bs1"), get_private_key("alice"_n, "bs1")); - block_signing_private_keys.emplace(get_public_key("alice"_n, "bs2"), get_private_key("alice"_n, "bs2")); - block_signing_private_keys.emplace(get_public_key("bob"_n, "bs1"), get_private_key("bob"_n, "bs1")); - block_signing_private_keys.emplace(get_public_key("bob"_n, "bs2"), get_private_key("bob"_n, "bs2")); + auto res = chain.set_producer_schedule( sch1 ); + chain.block_signing_private_keys.emplace(get_public_key("alice"_n, "bs1"), get_private_key("alice"_n, "bs1")); + chain.block_signing_private_keys.emplace(get_public_key("alice"_n, "bs2"), get_private_key("alice"_n, "bs2")); + chain.block_signing_private_keys.emplace(get_public_key("bob"_n, "bs1"), get_private_key("bob"_n, "bs1")); + chain.block_signing_private_keys.emplace(get_public_key("bob"_n, "bs2"), get_private_key("bob"_n, "bs2")); - BOOST_REQUIRE(produce_until_blocks_from(*this, {"alice"_n, "bob"_n}, 300)); + BOOST_REQUIRE(produce_until_blocks_from(chain, {"alice"_n, "bob"_n}, 300)); - BOOST_REQUIRE_EQUAL( validate(), true ); + BOOST_REQUIRE_EQUAL( chain.validate(), true ); } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( satisfiable_msig_test, validating_tester ) try { - create_accounts( {"alice"_n,"bob"_n} ); - produce_block(); +BOOST_AUTO_TEST_CASE_TEMPLATE(satisfiable_msig_test, T, validating_testers) try { + T chain; + chain.create_accounts( {"alice"_n,"bob"_n} ); + chain.produce_block(); vector sch1 = { producer_authority{"alice"_n, block_signing_authority_v0{2, {{get_public_key("alice"_n, "bs1"), 1}}}} @@ -549,17 +555,19 @@ BOOST_FIXTURE_TEST_CASE( satisfiable_msig_test, validating_tester ) try { // ensure that the entries in a wtmsig schedule are rejected if not satisfiable BOOST_REQUIRE_EXCEPTION( - set_producer_schedule( sch1 ), wasm_execution_error, + chain.set_producer_schedule( sch1 ), wasm_execution_error, fc_exception_message_is( "producer schedule includes an unsatisfiable authority for alice" ) ); - BOOST_REQUIRE_EQUAL( false, control->proposed_producers_legacy().has_value() ); + BOOST_REQUIRE_EQUAL( false, chain.control->proposed_producers_legacy().has_value() ); } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( duplicate_producers_test, validating_tester ) try { - create_accounts( {"alice"_n} ); - produce_block(); +BOOST_AUTO_TEST_CASE_TEMPLATE(duplicate_producers_test, T, validating_testers) try { + T chain; + + chain.create_accounts( {"alice"_n} ); + chain.produce_block(); vector sch1 = { producer_authority{"alice"_n, block_signing_authority_v0{1, {{get_public_key("alice"_n, "bs1"), 1}}}}, @@ -568,15 +576,15 @@ BOOST_FIXTURE_TEST_CASE( duplicate_producers_test, validating_tester ) try { // ensure that the schedule is rejected if it has duplicate producers in it BOOST_REQUIRE_EXCEPTION( - set_producer_schedule( sch1 ), wasm_execution_error, + chain.set_producer_schedule( sch1 ), wasm_execution_error, fc_exception_message_is( "duplicate producer name in producer schedule" ) ); - BOOST_REQUIRE_EQUAL( false, control->proposed_producers_legacy().has_value() ); + BOOST_REQUIRE_EQUAL( false, chain.control->proposed_producers_legacy().has_value() ); } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( duplicate_keys_test, validating_tester ) try { +BOOST_FIXTURE_TEST_CASE( duplicate_keys_test, legacy_validating_tester ) try { create_accounts( {"alice"_n,"bob"_n} ); produce_block(); @@ -645,7 +653,7 @@ BOOST_AUTO_TEST_CASE( large_authority_overflow_test ) try { } FC_LOG_AND_RETHROW() BOOST_AUTO_TEST_CASE( extra_signatures_test ) try { - tester main; + legacy_tester main; main.create_accounts( {"alice"_n} ); main.produce_block(); diff --git a/unittests/protocol_feature_tests.cpp b/unittests/protocol_feature_tests.cpp index bff4d3cd96..50793051d6 100644 --- a/unittests/protocol_feature_tests.cpp +++ b/unittests/protocol_feature_tests.cpp @@ -2002,8 +2002,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(set_parameters_packed_test, T, testers) { try { c.error("alice does not have permission to call this API")); } FC_LOG_AND_RETHROW() } -BOOST_AUTO_TEST_CASE_TEMPLATE(disable_deferred_trxs_stage_1_no_op_test, T, testers) { try { - T c(setup_policy::full_except_do_not_disable_deferred_trx); +BOOST_AUTO_TEST_CASE( disable_deferred_trxs_stage_1_no_op_test ) { try { + tester_no_disable_deferred_trx c; c.produce_block(); c.create_accounts( {"alice"_n, "bob"_n, "test"_n, "payloadless"_n} ); @@ -2124,8 +2124,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(disable_deferred_trxs_stage_1_no_op_test, T, teste // verify a deferred transaction can be retired as expired at any time regardless of // whether its delay_until or expiration have been reached -BOOST_AUTO_TEST_CASE_TEMPLATE(disable_deferred_trxs_stage_1_retire_test, T, testers) { try { - T c(setup_policy::full_except_do_not_disable_deferred_trx); +BOOST_AUTO_TEST_CASE( disable_deferred_trxs_stage_1_retire_test ) { try { + tester_no_disable_deferred_trx c; c.produce_block(); c.create_accounts( {"alice"_n, "test"_n} ); @@ -2189,8 +2189,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(disable_deferred_trxs_stage_1_retire_test, T, test BOOST_CHECK_EQUAL( c.control->get_resource_limits_manager().get_account_ram_usage( "alice"_n ), alice_ram_usage_before ); } FC_LOG_AND_RETHROW() } /// disable_deferred_trxs_stage_1_retire_test -BOOST_AUTO_TEST_CASE_TEMPLATE(disable_deferred_trxs_stage_2_test, T, testers) { try { - T c(setup_policy::full_except_do_not_disable_deferred_trx); +BOOST_AUTO_TEST_CASE( disable_deferred_trxs_stage_2_test ) { try { + tester_no_disable_deferred_trx c; c.produce_block(); c.create_accounts( {"alice"_n, "bob"_n, "test"_n} ); @@ -2256,8 +2256,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(disable_deferred_trxs_stage_2_test, T, testers) { BOOST_CHECK_EQUAL( c.control->get_resource_limits_manager().get_account_ram_usage( "bob"_n ), bob_ram_usage_before ); } FC_LOG_AND_RETHROW() } /// disable_deferred_trxs_stage_2_test -BOOST_AUTO_TEST_CASE_TEMPLATE(disable_deferred_trxs_stage_2_dependency_test, T, testers) { try { - T c(setup_policy::full_except_do_not_disable_deferred_trx); +BOOST_AUTO_TEST_CASE( disable_deferred_trxs_stage_2_dependency_test ) { try { + tester_no_disable_deferred_trx c; c.produce_block(); @@ -2272,9 +2272,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(disable_deferred_trxs_stage_2_dependency_test, T, // Verify a block containing delayed transactions is validated // before DISABLE_DEFERRED_TRXS_STAGE_1 is activated -BOOST_AUTO_TEST_CASE_TEMPLATE(block_validation_before_stage_1_test, T, testers) { try { - T tester1(setup_policy::full_except_do_not_disable_deferred_trx); - T tester2(setup_policy::full_except_do_not_disable_deferred_trx); +BOOST_AUTO_TEST_CASE( block_validation_before_stage_1_test ) { try { + tester_no_disable_deferred_trx tester1; + tester_no_disable_deferred_trx tester2; tester1.create_accounts( {"payloadless"_n} ); tester1.set_code( "payloadless"_n, test_contracts::payloadless_wasm() ); @@ -2291,8 +2291,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(block_validation_before_stage_1_test, T, testers) // Verify a block containing delayed transactions is not validated // after DISABLE_DEFERRED_TRXS_STAGE_1 is activated -BOOST_AUTO_TEST_CASE_TEMPLATE(block_validation_after_stage_1_test, T, testers) { try { - T tester1(setup_policy::full_except_do_not_disable_deferred_trx); +BOOST_AUTO_TEST_CASE( block_validation_after_stage_1_test ) { try { + tester_no_disable_deferred_trx tester1; // Activate DISABLE_DEFERRED_TRXS_STAGE_1 such that tester1 // matches tester2 below @@ -2327,16 +2327,12 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(block_validation_after_stage_1_test, T, testers) { copy_b->transaction_mroot = calculate_merkle_legacy( std::move(trx_digests) ); // Re-sign the block - if constexpr (std::is_same_v) { - copy_b->producer_signature = tester1.get_private_key(config::system_account_name, "active").sign(copy_b->calculate_id()); - } else { - auto header_bmroot = digest_type::hash( std::make_pair( copy_b->digest(), tester1.control->head_block_state_legacy()->blockroot_merkle.get_root() ) ); - auto sig_digest = digest_type::hash( std::make_pair(header_bmroot, tester1.control->head_block_state_legacy()->pending_schedule.schedule_hash) ); - copy_b->producer_signature = tester1.get_private_key(config::system_account_name, "active").sign(sig_digest); - } + auto header_bmroot = digest_type::hash( std::make_pair( copy_b->digest(), tester1.control->head_block_state_legacy()->blockroot_merkle.get_root() ) ); + auto sig_digest = digest_type::hash( std::make_pair(header_bmroot, tester1.control->head_block_state_legacy()->pending_schedule.schedule_hash) ); + copy_b->producer_signature = tester1.get_private_key(config::system_account_name, "active").sign(sig_digest); // Create the second chain - T tester2(setup_policy::full_except_do_not_disable_deferred_trx); + tester_no_disable_deferred_trx tester2; // Activate DISABLE_DEFERRED_TRXS_STAGE_1 on the second chain const auto& pfm2 = tester2.control->get_protocol_feature_manager(); auto d2 = pfm2.get_builtin_digest( builtin_protocol_feature_t::disable_deferred_trxs_stage_1 ); diff --git a/unittests/restart_chain_tests.cpp b/unittests/restart_chain_tests.cpp index 915e37e429..3c792844ea 100644 --- a/unittests/restart_chain_tests.cpp +++ b/unittests/restart_chain_tests.cpp @@ -54,14 +54,10 @@ FC_REFLECT(cf_action, (payload)(cfd_idx)) #define DUMMY_ACTION_DEFAULT_B 0xab11cd1244556677 #define DUMMY_ACTION_DEFAULT_C 0x7451ae12 -template class replay_tester : public base_tester { public: template replay_tester(controller::config config, const genesis_state& genesis, OnAppliedTrx&& on_applied_trx) { - if constexpr (std::is_same_v) { - is_savanna = true; - } cfg = config; base_tester::open(make_protocol_feature_set(), genesis.compute_chain_id(), [&genesis,&control=this->control, &on_applied_trx]() { control->applied_transaction().connect(on_applied_trx); @@ -218,7 +214,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_light_validation_restart_from_block_log, T, remove_existing_states(copied_config); transaction_trace_ptr other_trace; - replay_tester from_block_log_chain(copied_config, *genesis, + replay_tester from_block_log_chain(copied_config, *genesis, [&](std::tuple x) { auto& t = std::get<0>(x); if (t && t->id == trace->id) { diff --git a/unittests/state_history_tests.cpp b/unittests/state_history_tests.cpp index cac7d5e9e2..847d06fe79 100644 --- a/unittests/state_history_tests.cpp +++ b/unittests/state_history_tests.cpp @@ -67,9 +67,11 @@ std::vector create_deltas(const chainbase::database& db, bool full_ BOOST_AUTO_TEST_SUITE(test_state_history) -class table_deltas_tester : public tester { +class table_deltas_tester : public legacy_tester { public: - using tester::tester; + // Use leacy_tester temporarily until https://github.com/AntelopeIO/spring/issues/179 + // is resolved. + using legacy_tester::legacy_tester; using deltas_vector = vector; pair find_table_delta(const std::string &name, bool full_snapshot = false) { @@ -452,7 +454,7 @@ BOOST_AUTO_TEST_CASE(test_deltas_resources_history) { } BOOST_AUTO_TEST_CASE(test_deltas) { - tester main; + legacy_tester main; auto v = eosio::state_history::create_deltas(main.control->db(), false); @@ -621,11 +623,11 @@ struct state_history_tester_logs { eosio::state_history::trace_converter trace_converter; }; -struct state_history_tester : state_history_tester_logs, tester { +struct state_history_tester : state_history_tester_logs, legacy_tester { state_history_tester(const std::filesystem::path& dir, const eosio::state_history_log_config& config) - : state_history_tester_logs(dir, config), tester ([this](eosio::chain::controller& control) { + : state_history_tester_logs(dir, config), legacy_tester ([this](eosio::chain::controller& control) { control.applied_transaction().connect( [&](std::tuple t) { trace_converter.add_transaction(std::get<0>(t), std::get<1>(t)); diff --git a/unittests/wasm-spec-tests/generated-tests/CMakeLists.txt b/unittests/wasm-spec-tests/generated-tests/CMakeLists.txt index a3afc63d2c..7b066eb988 100644 --- a/unittests/wasm-spec-tests/generated-tests/CMakeLists.txt +++ b/unittests/wasm-spec-tests/generated-tests/CMakeLists.txt @@ -41,7 +41,8 @@ set(ctest_tests "'${ctest_tests}' -j8") # surround test list string in apostroph # The following tests are known to take the longest, bump up their cost (priority) so that they'll run first # even on fresh first time test runs before ctest auto-detects costs foreach(RUNTIME ${EOSIO_WASM_RUNTIMES}) - set_tests_properties(memory_trap_1_check_throw_unit_test_${RUNTIME} PROPERTIES COST 5000) + set_tests_properties(memory_trap_1_check_throw_1_unit_test_${RUNTIME} PROPERTIES COST 4000) + set_tests_properties(memory_trap_1_check_throw_2_unit_test_${RUNTIME} PROPERTIES COST 4000) set_tests_properties(conversions_0_check_throw_unit_test_${RUNTIME} PROPERTIES COST 2500) set_tests_properties(unreachable_0_check_throw_unit_test_${RUNTIME} PROPERTIES COST 2500) set_tests_properties(f64_0_pass_unit_test_${RUNTIME} PROPERTIES COST 2500) diff --git a/unittests/wasm-spec-tests/generated-tests/memory_trap.cpp b/unittests/wasm-spec-tests/generated-tests/memory_trap.cpp index ee8c62abde..b0ef5afcca 100644 --- a/unittests/wasm-spec-tests/generated-tests/memory_trap.cpp +++ b/unittests/wasm-spec-tests/generated-tests/memory_trap.cpp @@ -41,8 +41,7 @@ BOOST_DATA_TEST_CASE(memory_trap_0_pass, boost::unit_test::data::xrange(10,11), const string wasm_str_memory_trap_1 = base_dir + "/memory_trap.1.wasm"; std::vector wasm_memory_trap_1= read_wasm(wasm_str_memory_trap_1.c_str()); -BOOST_DATA_TEST_CASE(memory_trap_1_check_throw, boost::unit_test::data::xrange(0,156), index) { try { - TESTER tester; +void memory_trap_1_check_throw_common(TESTER& tester, uint32_t index) { tester.produce_block(); tester.create_account( "wasmtest"_n ); tester.produce_block(); @@ -56,6 +55,16 @@ BOOST_DATA_TEST_CASE(memory_trap_1_check_throw, boost::unit_test::data::xrange(0 BOOST_CHECK_THROW(push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t()), wasm_execution_error); tester.produce_block(); +} + +BOOST_DATA_TEST_CASE(memory_trap_1_check_throw_1, boost::unit_test::data::xrange(0,78), index) { try { + TESTER tester; + memory_trap_1_check_throw_common(tester, index); +} FC_LOG_AND_RETHROW() } + +BOOST_DATA_TEST_CASE(memory_trap_1_check_throw_2, boost::unit_test::data::xrange(78,156), index) { try { + TESTER tester; + memory_trap_1_check_throw_common(tester, index); } FC_LOG_AND_RETHROW() } BOOST_DATA_TEST_CASE(memory_trap_1_pass, boost::unit_test::data::xrange(156,157), index) { try {