Skip to content

Commit

Permalink
test adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Florentine <[email protected]>
  • Loading branch information
jflo committed Nov 8, 2023
1 parent 25bb9fc commit 3cc7fbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ public Transaction createTransaction(final KeyPair keys) {
builder.maxFeePerGas(maxFeePerGas.orElse(Wei.of(5000)));
builder.accessList(accessListEntries.orElse(List.of()));
builder.maxFeePerBlobGas(maxFeePerBlobGas.orElse(Wei.ONE));
builder.versionedHashes(
versionedHashes.orElse(List.of(VersionedHash.DEFAULT_VERSIONED_HASH)));
blobs.ifPresent(
bwc -> {
builder.kzgBlobs(bwc.getKzgCommitments(), bwc.getBlobs(), bwc.getKzgProofs());
});
if(blobs.isPresent()) {
builder.kzgBlobs(blobs.get().getKzgCommitments(), blobs.get().getBlobs(), blobs.get().getKzgProofs());
} else if(versionedHashes.isPresent()){
builder.versionedHashes(versionedHashes.get());
}
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public abstract class AbstractTransactionPoolTest {
protected PendingTransactions transactions;
protected final Transaction transaction0 = createTransaction(0);
protected final Transaction transaction1 = createTransaction(1);
protected final Transaction transactionBlob = createBlobTransaction(0);
protected final Transaction transactionBlob = createBlobTransaction(2);

protected final Transaction transactionOtherSender = createTransaction(1, KEY_PAIR2);
private ExecutionContextTestFixture executionContext;
Expand Down Expand Up @@ -326,7 +326,7 @@ public void shouldReturnLocalTransactionsWhenAppropriate(final boolean noLocalPr

assertThat(transactions.size()).isEqualTo(3);
assertThat(transactions.getLocalTransactions()).contains(localTransaction2);
assertThat(transactions.getPriorityTransactions().size()).isEqualTo(noLocalPriority ? 0 : 1);
assertThat(transactions.getPriorityTransactions()).hasSize(noLocalPriority ? 0 : 1);
}

@Test
Expand Down Expand Up @@ -469,7 +469,7 @@ public void shouldReAddBlobTxsWhenReorgHappens() {

addAndAssertRemoteTransactionsValid(transaction0);
addAndAssertRemoteTransactionsValid(transaction1);
addAndAssertRemoteTransactionInvalid(transactionBlob);
addAndAssertRemoteTransactionsValid(transactionBlob);

final BlockHeader commonParent = getHeaderForCurrentChainHead();
final Block originalFork1 = appendBlock(Difficulty.of(1000), commonParent, transaction0);
Expand Down Expand Up @@ -1222,7 +1222,7 @@ public void shouldRejectRemote1559TxsWhenMaxFeePerGasBelowMinGasPrice(final bool
assertThat(
add1559TxAndGetPendingTxsCount(
genesisBaseFee, minGasPrice, lastBlockBaseFee, txMaxFeePerGas, false, hasPriority))
.isEqualTo(0);
.isZero();
}

@ParameterizedTest
Expand Down Expand Up @@ -1250,7 +1250,7 @@ public void shouldRejectLocal1559TxsWhenMaxFeePerGasBelowMinGasPrice() {
assertThat(
add1559TxAndGetPendingTxsCount(
genesisBaseFee, minGasPrice, lastBlockBaseFee, txMaxFeePerGas, true, true))
.isEqualTo(0);
.isZero();
}

@Test
Expand Down

0 comments on commit 3cc7fbc

Please sign in to comment.