@ -31,6 +31,7 @@ import org.hyperledger.besu.ethereum.eth.transactions.sorter.GasPricePendingTran
import java.time.Instant ;
import java.util.HashMap ;
import java.util.Map ;
import java.util.Objects ;
import java.util.Set ;
import java.util.stream.Collectors ;
@ -74,6 +75,31 @@ public class TxPoolBesuPendingTransactionsTest {
assertThat ( result . size ( ) ) . isEqualTo ( 4 ) ;
}
@Test
public void pendingTransactionsGasPricesDoNotHaveLeadingZeroes ( ) {
final JsonRpcRequestContext request =
new JsonRpcRequestContext (
new JsonRpcRequest (
JSON_RPC_VERSION , TXPOOL_PENDING_TRANSACTIONS_METHOD , new Object [ ] { 100 } ) ) ;
final JsonRpcSuccessResponse actualResponse = ( JsonRpcSuccessResponse ) method . response ( request ) ;
final Set < TransactionPendingResult > result =
( Set < TransactionPendingResult > ) actualResponse . getResult ( ) ;
assertThat ( result )
. extracting ( TransactionPendingResult : : getGasPrice )
. filteredOn ( Objects : : nonNull )
. allSatisfy ( p - > assertThat ( p ) . doesNotContain ( "0x0" ) ) ;
assertThat ( result )
. extracting ( TransactionPendingResult : : getMaxFeePerGas )
. filteredOn ( Objects : : nonNull )
. allSatisfy ( p - > assertThat ( p ) . doesNotContain ( "0x0" ) ) ;
assertThat ( result )
. extracting ( TransactionPendingResult : : getMaxPriorityFeePerGas )
. filteredOn ( Objects : : nonNull )
. allSatisfy ( p - > assertThat ( p ) . doesNotContain ( "0x0" ) ) ;
}
@Test
public void shouldReturnPendingTransactionsWithLimit ( ) {
final JsonRpcRequestContext request =