Skip to content

Commit

Permalink
GH-2033 Add head_active_producers() needed by tester
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jan 8, 2024
1 parent 42513fe commit 2f7c127
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3986,6 +3986,10 @@ const producer_authority_schedule& controller::active_producers()const {
return my->pending->active_producers();
}

const producer_authority_schedule& controller::head_active_producers()const {
return my->block_data.head_active_schedule_auth();
}

const producer_authority_schedule& controller::pending_producers()const {
if( !(my->pending) )
return my->block_data.head_pending_schedule_auth(); // [greg todo] implement pending_producers correctly for IF mode
Expand Down
1 change: 1 addition & 0 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ namespace eosio::chain {
uint32_t pending_block_num()const;

const producer_authority_schedule& active_producers()const;
const producer_authority_schedule& head_active_producers()const;
const producer_authority_schedule& pending_producers()const;
std::optional<producer_authority_schedule> proposed_producers()const;

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

void base_tester::_start_block(fc::time_point block_time) {
auto head_block_number = control->head_block_num();
auto producer = control->active_producers().get_scheduled_producer(block_time);
auto producer = control->head_active_producers().get_scheduled_producer(block_time);

auto last_produced_block_num = control->last_irreversible_block_num();
auto itr = last_produced_block.find(producer.producer_name);
Expand Down

0 comments on commit 2f7c127

Please sign in to comment.