Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Fix existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsmale90 committed Apr 7, 2022
1 parent b4c6d2b commit 6f2d2aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/chains/ethereum/ethereum/src/transaction-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ export default class TransactionPool extends Emittery<{ drain: undefined }> {

// transaction maxGasPerFee must be greater or equal to baseFeePerGas _of the pending block_
if ("maxFeePerGas" in transaction && !transaction.maxFeePerGas.isNull()) {
console.log(this.#blockchain.blocks.latest);
const nextBaseFee = Block.calcNextBaseFee(this.#blockchain.blocks.latest);
if (transaction.maxFeePerGas.toBigInt() < nextBaseFee) {
return new CodedError(
Expand Down
9 changes: 5 additions & 4 deletions src/chains/ethereum/ethereum/tests/transaction-pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe("transaction pool", async () => {
futureNonceRpc = {
from: from,
type: "0x2",
maxFeePerGas: "0xffffff",
maxFeePerGas: "0x2da282a8",
maxPriorityFeePerGas: "0xff",
gasLimit: "0xffff",
nonce: "0x2"
Expand Down Expand Up @@ -92,7 +92,7 @@ describe("transaction pool", async () => {
},
common,
blocks: {
latest: { header: { baseFeePerGas: Quantity.from(875000000) } }
latest: { header: { baseFeePerGas: Quantity.from(875000000), gasUsed: Quantity.from(0), gasLimit: Quantity.from(12012000) } }
}
};
});
Expand Down Expand Up @@ -148,7 +148,7 @@ describe("transaction pool", async () => {
},
common,
blocks: {
latest: { header: { baseFeePerGas: Quantity.from(875000000) } }
latest: { header: { baseFeePerGas: Quantity.from(875000000), gasUsed: Quantity.from(0), gasLimit: Quantity.from(12012000) } }
}
} as any;
const txPool = new TransactionPool(options.miner, fakeNonceChain, origins);
Expand Down Expand Up @@ -240,6 +240,7 @@ describe("transaction pool", async () => {
found.serialized.toString(),
futureNonceTx.serialized.toString()
);

// now, if we resend the same transaction, since the gas price isn't higher,
// it should be rejected
await assert.rejects(
Expand All @@ -257,7 +258,7 @@ describe("transaction pool", async () => {
from,
type: "0x2",
value: "0xfffffffffffffffffff",
maxFeePerGas: "0xffffff",
maxFeePerGas: "0x2da282a8",
maxPriorityFeePerGas: "0xff",
gasLimit: "0xffff"
};
Expand Down

0 comments on commit 6f2d2aa

Please sign in to comment.