Skip to content

Commit

Permalink
IS-833 More easy check
Browse files Browse the repository at this point in the history
  • Loading branch information
dimalit committed Apr 24, 2024
1 parent 0734b8a commit da1ce62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libethereum/ClientBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ LocalisedLogEntries ClientBase::logs( LogFilter const& _f ) const {
unsigned begin = min( bc().number() + 1, ( unsigned ) _f.latest() );
unsigned end = min( bc().number(), min( begin, ( unsigned ) _f.earliest() ) );

if ( begin >= end && begin - end >= bc().chainParams().getLogsBlocksLimit )
if ( begin >= end && begin - end > bc().chainParams().getLogsBlocksLimit )
BOOST_THROW_EXCEPTION( TooBigResponse() );

// Handle pending transactions differently as they're not on the block chain.
Expand Down
6 changes: 3 additions & 3 deletions test/unittests/libweb3jsonrpc/jsonrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,7 @@ contract Logger{
t["to"] = contractAddress;
t["gas"] = "99000";

for(int i=0; i<10; ++i){
for(int i=0; i<11; ++i){

std::string txHash = fixture.rpcClient->eth_sendTransaction( t );
BOOST_REQUIRE( !txHash.empty() );
Expand All @@ -2172,7 +2172,7 @@ contract Logger{
// ask for logs
Json::Value req;
req["fromBlock"] = 1;
req["toBlock"] = 10;
req["toBlock"] = 11;
req["topics"] = Json::Value(Json::arrayValue);

// 1 10 blocks
Expand All @@ -2183,7 +2183,7 @@ contract Logger{
BOOST_REQUIRE_NO_THROW( Json::Value logs = fixture.rpcClient->eth_getLogs(req) );

// 3 11 blocks
req["toBlock"] = 11;
req["toBlock"] = 12;
BOOST_REQUIRE_THROW( Json::Value logs = fixture.rpcClient->eth_getLogs(req), std::exception );

// 4 filter
Expand Down

0 comments on commit da1ce62

Please sign in to comment.