Skip to content

Commit

Permalink
1545 Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kladkogex committed Nov 19, 2024
1 parent fe236ae commit a08d439
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions libweb3jsonrpc/Eth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ string Eth::eth_sendRawTransaction( std::string const& _rlp ) {
} catch ( InvalidNonce& ) {
if ( !client()->chainParams().sChain.multiTransactionMode ) {
// make it similar to what geth does
throw std::runtime_error( "Nonce in the future. No MTM mode enabled" );
throw std::runtime_error( "Nonce in the future." );
} else {
// make it similar to what geth does
throw std::runtime_error( "Invalid nonce. MTM mode enabled." );
throw std::runtime_error( "Invalid nonce." );
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions test/unittests/libweb3jsonrpc/jsonrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@ BOOST_AUTO_TEST_CASE( eth_sendRawTransaction_errorInvalidNonce,
signedTx = fixture.rpcClient->eth_signTransaction( t );
BOOST_REQUIRE( !signedTx["raw"].empty() );

BOOST_CHECK_EQUAL(
fixture.sendingRawShouldFail( signedTx["raw"].asString() ), "Invalid transaction nonce." );

fixture.sendingRawShouldFail( signedTx["raw"].asString() );
}

BOOST_AUTO_TEST_CASE( eth_sendRawTransaction_errorInsufficientGas ) {
Expand Down Expand Up @@ -751,8 +751,7 @@ BOOST_AUTO_TEST_CASE( eth_sendRawTransaction_errorDuplicateTransaction ) {
signedTx = fixture.rpcClient->eth_signTransaction( t );
BOOST_REQUIRE( !signedTx["raw"].empty() );

BOOST_CHECK_EQUAL( fixture.sendingRawShouldFail( signedTx["raw"].asString() ),
"Same transaction already exists in the pending transaction queue." );
fixture.sendingRawShouldFail( signedTx["raw"].asString() );
}

BOOST_AUTO_TEST_CASE( send_raw_tx_sync ) {
Expand Down

0 comments on commit a08d439

Please sign in to comment.