Skip to content

Commit bf96790

Browse files
committed
only replace tx when gas price goes up
1 parent 08bd979 commit bf96790

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/tests/ts-integration/src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ export async function waitForNewL1Batch(wallet: zksync.Wallet): Promise<zksync.t
8282
// is to fetch `maxFeePerGas` from the latest sealed block and double it which is not enough for scenarios with
8383
// extreme gas price fluctuations.
8484
let gasPrice = await wallet.provider.getGasPrice();
85-
if (!txResponse || txResponse.maxFeePerGas != gasPrice) {
85+
if (!txResponse || !txResponse.maxFeePerGas || txResponse.maxFeePerGas < gasPrice) {
8686
txResponse = await wallet.transfer({
8787
to: wallet.address,
8888
amount: 0,
8989
overrides: { maxFeePerGas: gasPrice, nonce: nonce, maxPriorityFeePerGas: 0 }
9090
});
9191
} else {
92-
console.log('Gas price has not changed, waiting longer');
92+
console.log('Gas price has not gone up, waiting longer');
9393
}
9494
txReceipt = await Promise.race([
9595
txResponse.wait().then((receipt) => receipt as TransactionReceipt | null),

0 commit comments

Comments
 (0)