Skip to content

Commit b951e21

Browse files
authored
Add detailed gas fee logging (#331)
1 parent fc70f94 commit b951e21

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/worker/tasks/processTx.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,6 @@ export const processTx = async () => {
189189
const nonce = startNonce.add(sentTxCount);
190190

191191
try {
192-
logger.worker.info(
193-
`maxFeePerGas ${
194-
gasOverrides.maxFeePerGas !== undefined
195-
? formatUnits(gasOverrides.maxFeePerGas, "gwei")
196-
: undefined
197-
}`,
198-
);
199-
logger.worker.info(
200-
`maxPriorityFeePerGas ${
201-
gasOverrides.maxPriorityFeePerGas !== undefined
202-
? formatUnits(gasOverrides.maxPriorityFeePerGas, "gwei")
203-
: undefined
204-
}`,
205-
);
206-
207192
const txRequest = await signer.populateTransaction({
208193
to: tx.toAddress!,
209194
from: tx.fromAddress!,
@@ -212,6 +197,23 @@ export const processTx = async () => {
212197
nonce,
213198
...gasOverrides,
214199
});
200+
201+
logger.worker.info(
202+
`[Transaction] [${tx.queueId}] Using maxFeePerGas ${
203+
txRequest.maxFeePerGas !== undefined
204+
? formatUnits(txRequest.maxFeePerGas, "gwei")
205+
: undefined
206+
}, maxPriorityFeePerGas ${
207+
txRequest.maxPriorityFeePerGas !== undefined
208+
? formatUnits(txRequest.maxPriorityFeePerGas, "gwei")
209+
: undefined
210+
}, gasPrice ${
211+
txRequest.gasPrice !== undefined
212+
? formatUnits(txRequest.gasPrice, "gwei")
213+
: undefined
214+
}`,
215+
);
216+
215217
const signature = await signer.signTransaction(txRequest);
216218

217219
logger.worker.info(

0 commit comments

Comments
 (0)