Skip to content

Commit

Permalink
Fix broken tests #675
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Vandeberg committed Dec 8, 2016
1 parent 51f99ca commit e21d608
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libraries/chain/block_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace steemit { namespace chain {
{
optional< signed_block > b;
uint64_t pos = get_block_pos( block_num );
if( !pos )
if( ~pos )
b = read_block( pos ).first;
return b;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ optional<signed_block> database::fetch_block_by_number( uint32_t block_num )cons
}
else
{
b = _block_log.read_block_by_num( stats->block_num() );
b = _block_log.read_block_by_num( block_num );
}

return b;
Expand Down
4 changes: 3 additions & 1 deletion tests/tests/block_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ BOOST_AUTO_TEST_CASE( generate_empty_blocks )
uint32_t cutoff_height = db.get_dynamic_global_properties().last_irreversible_block_num;
if( cutoff_height >= 200 )
{
cutoff_block = *(db.fetch_block_by_number( cutoff_height ));
auto block = db.fetch_block_by_number( cutoff_height );
BOOST_REQUIRE( block.valid() );
cutoff_block = *block;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/operation_time_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,7 @@ BOOST_AUTO_TEST_CASE( sbd_stability )
auto& gpo = db.get_dynamic_global_properties();
BOOST_REQUIRE( gpo.sbd_print_rate >= last_print_rate );
last_print_rate = gpo.sbd_print_rate;
db_plugin->debug_generate_blocks( debug_key, 1, ~0 );
db_plugin->debug_generate_blocks( debug_key, 1, database::skip_witness_signature );
validate_database();
}

Expand Down

0 comments on commit e21d608

Please sign in to comment.