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

Remove unused skip_flag in base_tester::produce_block #7075

Merged
merged 1 commit into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
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
26 changes: 13 additions & 13 deletions libraries/testing/include/eosio/testing/tester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ namespace eosio { namespace testing {
void open( const snapshot_reader_ptr& snapshot );
bool is_same_chain( base_tester& other );

virtual signed_block_ptr produce_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0/*skip_missed_block_penalty*/ ) = 0;
virtual signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0/*skip_missed_block_penalty*/ ) = 0;
virtual signed_block_ptr produce_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) ) = 0;
virtual signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) ) = 0;
virtual signed_block_ptr finish_block() = 0;
void produce_blocks( uint32_t n = 1, bool empty = false );
void produce_blocks_until_end_of_round();
Expand Down Expand Up @@ -281,7 +281,7 @@ namespace eosio { namespace testing {
}

protected:
signed_block_ptr _produce_block( fc::microseconds skip_time, bool skip_pending_trxs = false, uint32_t skip_flag = 0 );
signed_block_ptr _produce_block( fc::microseconds skip_time, bool skip_pending_trxs = false );
void _start_block(fc::time_point block_time);
signed_block_ptr _finish_block();

Expand All @@ -308,13 +308,13 @@ namespace eosio { namespace testing {
init(config);
}

signed_block_ptr produce_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0/*skip_missed_block_penalty*/ )override {
return _produce_block(skip_time, false, skip_flag);
signed_block_ptr produce_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) )override {
return _produce_block(skip_time, false);
}

signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0/*skip_missed_block_penalty*/ )override {
signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) )override {
control->abort_block();
return _produce_block(skip_time, true, skip_flag);
return _produce_block(skip_time, true);
}

signed_block_ptr finish_block()override {
Expand Down Expand Up @@ -388,26 +388,26 @@ namespace eosio { namespace testing {
init(config);
}

signed_block_ptr produce_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0 /*skip_missed_block_penalty*/ )override {
auto sb = _produce_block(skip_time, false, skip_flag | 2);
signed_block_ptr produce_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) )override {
auto sb = _produce_block(skip_time, false);
auto bs = validating_node->create_block_state_future( sb );
validating_node->push_block( bs );

return sb;
}

signed_block_ptr produce_block_no_validation( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0 /*skip_missed_block_penalty*/ ) {
return _produce_block(skip_time, false, skip_flag | 2);
signed_block_ptr produce_block_no_validation( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) ) {
return _produce_block(skip_time, false);
}

void validate_push_block(const signed_block_ptr& sb) {
auto bs = validating_node->create_block_state_future( sb );
validating_node->push_block( bs );
}

signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0 /*skip_missed_block_penalty*/ )override {
signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) )override {
control->abort_block();
auto sb = _produce_block(skip_time, true, skip_flag | 2);
auto sb = _produce_block(skip_time, true);
auto bs = validating_node->create_block_state_future( sb );
validating_node->push_block( bs );

Expand Down
2 changes: 1 addition & 1 deletion libraries/testing/tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace eosio { namespace testing {
return b;
}

signed_block_ptr base_tester::_produce_block( fc::microseconds skip_time, bool skip_pending_trxs, uint32_t skip_flag) {
signed_block_ptr base_tester::_produce_block( fc::microseconds skip_time, bool skip_pending_trxs) {
auto head = control->head_block_state();
auto head_time = control->head_block_time();
auto next_time = head_time + skip_time;
Expand Down
8 changes: 4 additions & 4 deletions unittests/snapshot_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ class snapshotted_tester : public base_tester {

init(copied_config, snapshot);
}
signed_block_ptr produce_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0/*skip_missed_block_penalty*/ )override {
return _produce_block(skip_time, false, skip_flag);
signed_block_ptr produce_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) )override {
return _produce_block(skip_time, false);
}

signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0/*skip_missed_block_penalty*/ )override {
signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms) )override {
control->abort_block();
return _produce_block(skip_time, true, skip_flag);
return _produce_block(skip_time, true);
}

signed_block_ptr finish_block()override {
Expand Down