Skip to content

Commit

Permalink
Add detailed gas fee logging (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-maj authored Dec 4, 2023
1 parent fc70f94 commit b951e21
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/worker/tasks/processTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,6 @@ export const processTx = async () => {
const nonce = startNonce.add(sentTxCount);

try {
logger.worker.info(
`maxFeePerGas ${
gasOverrides.maxFeePerGas !== undefined
? formatUnits(gasOverrides.maxFeePerGas, "gwei")
: undefined
}`,
);
logger.worker.info(
`maxPriorityFeePerGas ${
gasOverrides.maxPriorityFeePerGas !== undefined
? formatUnits(gasOverrides.maxPriorityFeePerGas, "gwei")
: undefined
}`,
);

const txRequest = await signer.populateTransaction({
to: tx.toAddress!,
from: tx.fromAddress!,
Expand All @@ -212,6 +197,23 @@ export const processTx = async () => {
nonce,
...gasOverrides,
});

logger.worker.info(
`[Transaction] [${tx.queueId}] Using maxFeePerGas ${
txRequest.maxFeePerGas !== undefined
? formatUnits(txRequest.maxFeePerGas, "gwei")
: undefined
}, maxPriorityFeePerGas ${
txRequest.maxPriorityFeePerGas !== undefined
? formatUnits(txRequest.maxPriorityFeePerGas, "gwei")
: undefined
}, gasPrice ${
txRequest.gasPrice !== undefined
? formatUnits(txRequest.gasPrice, "gwei")
: undefined
}`,
);

const signature = await signer.signTransaction(txRequest);

logger.worker.info(
Expand Down

0 comments on commit b951e21

Please sign in to comment.