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

port consolidated security fixes for 1.8.4 to develop; add unit tests associated with consolidated security fixes for 1.8.1 #7983

Merged
merged 2 commits into from
Sep 25, 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
3 changes: 2 additions & 1 deletion libraries/chain/include/eosio/chain/wasm_eosio_injection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@ namespace eosio { namespace chain { namespace wasm_injections {
};

struct post_op_full_injectors : post_op_injectors {
using loop_t = wasm_ops::loop <checktime_injection>;
using loop_t = wasm_ops::loop <checktime_injection>;
using grow_memory_t = wasm_ops::grow_memory <checktime_injection>;
};

template <typename ... Visitors>
Expand Down
22 changes: 22 additions & 0 deletions unittests/producer_schedule_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,29 @@ BOOST_AUTO_TEST_CASE( producer_watermark_test ) try {
BOOST_CHECK_EQUAL( true, compare_schedules( sch1, *c.control->proposed_producers() ) );

produce_until_transition( c, N(bob), N(alice) );

auto bob_last_produced_block_num = c.control->head_block_num();
wdump((bob_last_produced_block_num));

produce_until_transition( c, N(alice), N(bob) );

auto alice_last_produced_block_num = c.control->head_block_num();
wdump((alice_last_produced_block_num));

{
wdump((c.control->head_block_state()->producer_to_last_produced));
const auto& last_produced = c.control->head_block_state()->producer_to_last_produced;
auto alice_itr = last_produced.find( N(alice) );
BOOST_REQUIRE( alice_itr != last_produced.end() );
BOOST_CHECK_EQUAL( alice_itr->second, alice_last_produced_block_num );
auto bob_itr = last_produced.find( N(bob) );
BOOST_REQUIRE( bob_itr != last_produced.end() );
BOOST_CHECK_EQUAL( bob_itr->second, bob_last_produced_block_num );
auto carol_itr = last_produced.find( N(carol) );
BOOST_REQUIRE( carol_itr != last_produced.end() );
BOOST_CHECK_EQUAL( carol_itr->second, carol_last_produced_block_num );
}

BOOST_CHECK_EQUAL( c.control->pending_producers().version, 3u );
BOOST_REQUIRE_EQUAL( c.control->active_producers().version, 2u );

Expand Down