Skip to content

Commit

Permalink
feat: test running with lower priority fee
Browse files Browse the repository at this point in the history
  • Loading branch information
piesrtasty committed Mar 23, 2024
1 parent d6fa74d commit 542e2fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const checkBalance = (signerBalance: any, txFee: any) => {

export const getTxFeeAndCheckBalance = async (gasUnits: any, provider: any, txSigner: any) => {
const gasPrice = await provider.getGasPrice();

const txFee = gasUnits.mul(gasPrice);

const signerBalance = await provider.getBalance(txSigner.address);
Expand All @@ -23,6 +24,7 @@ export const processTx = async (tx: any, txSigner: any, gasUnits: any) => {
if (!tx) throw new Error('No transaction request!');

tx.gasLimit = gasUnits;
tx.maxPriorityFeePerGas = 1;
const txData = await txSigner.sendTransaction(tx);
await txData.wait();
};
Expand Down

0 comments on commit 542e2fe

Please sign in to comment.