From 32f07de4e2f5b9676aaba77dae8de0055577e56b Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Mon, 15 Feb 2016 16:56:14 -0500 Subject: [PATCH] Fix unit test failure due to skip_flags changes caused by #492 fix --- tests/common/database_fixture.cpp | 8 ++++---- tests/common/database_fixture.hpp | 2 +- tests/tests/fee_tests.cpp | 17 +++++++++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index e42a22b4..67e4dd0d 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -320,20 +320,20 @@ void database_fixture::generate_blocks( uint32_t block_count ) generate_block(); } -void database_fixture::generate_blocks(fc::time_point_sec timestamp, bool miss_intermediate_blocks) +void database_fixture::generate_blocks(fc::time_point_sec timestamp, bool miss_intermediate_blocks, uint32_t skip) { if( miss_intermediate_blocks ) { - generate_block(); + generate_block(skip); auto slots_to_miss = db.get_slot_at_time(timestamp); if( slots_to_miss <= 1 ) return; --slots_to_miss; - generate_block(~0, init_account_priv_key, slots_to_miss); + generate_block(skip, init_account_priv_key, slots_to_miss); return; } while( db.head_block_time() < timestamp ) - generate_block(); + generate_block(skip); } account_create_operation database_fixture::make_account( diff --git a/tests/common/database_fixture.hpp b/tests/common/database_fixture.hpp index 241fd079..ec5e9bd7 100644 --- a/tests/common/database_fixture.hpp +++ b/tests/common/database_fixture.hpp @@ -183,7 +183,7 @@ struct database_fixture { * @brief Generates blocks until the head block time matches or exceeds timestamp * @param timestamp target time to generate blocks until */ - void generate_blocks(fc::time_point_sec timestamp, bool miss_intermediate_blocks = true); + void generate_blocks(fc::time_point_sec timestamp, bool miss_intermediate_blocks = true, uint32_t skip = ~0); account_create_operation make_account( const std::string& name = "nathan", diff --git a/tests/tests/fee_tests.cpp b/tests/tests/fee_tests.cpp index 9d7f0281..e6fd6748 100644 --- a/tests/tests/fee_tests.cpp +++ b/tests/tests/fee_tests.cpp @@ -620,14 +620,23 @@ BOOST_AUTO_TEST_CASE( fee_refund_test ) int64_t order_create_fee = 537; int64_t order_cancel_fee = 129; - generate_block(); + uint32_t skip = database::skip_witness_signature + | database::skip_transaction_signatures + | database::skip_transaction_dupe_check + | database::skip_block_size_check + | database::skip_tapos_check + | database::skip_authority_check + | database::skip_merkle_check + ; + + generate_block( skip ); for( int i=0; i<2; i++ ) { if( i == 1 ) { - generate_blocks( HARDFORK_445_TIME ); - generate_block(); + generate_blocks( HARDFORK_445_TIME, true, skip ); + generate_block( skip ); } // enable_fees() and change_fees() modifies DB directly, and results will be overwritten by block generation @@ -719,7 +728,7 @@ BOOST_AUTO_TEST_CASE( fee_refund_test ) // but we'll save that for future cleanup // undo above tx's and reset - generate_block(); + generate_block( skip ); db.pop_block(); } }