Skip to content

Commit

Permalink
Merge pull request #279 from pimlicolabs/effectiveGasPrice
Browse files Browse the repository at this point in the history
fix in rpc call too
  • Loading branch information
plusminushalf authored Aug 5, 2024
2 parents 000b8c4 + f1136fe commit 91a2968
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/rpc/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,28 @@ export class RpcHandler implements IRpcEndpoint {
): Promise<TransactionReceipt> => {
while (true) {
try {
return await this.publicClient.getTransactionReceipt({
hash: txHash
})
const transactionReceipt =
await this.publicClient.getTransactionReceipt({
hash: txHash
})

let effectiveGasPrice: bigint | undefined =
transactionReceipt.effectiveGasPrice ??
(transactionReceipt as any).gasPrice ??
undefined

if (effectiveGasPrice === undefined) {
const tx = await this.publicClient.getTransaction({
hash: txHash
})
effectiveGasPrice = tx.gasPrice ?? undefined
}

if (effectiveGasPrice) {
transactionReceipt.effectiveGasPrice = effectiveGasPrice
}

return transactionReceipt
} catch (e) {
if (e instanceof TransactionReceiptNotFoundError) {
continue
Expand Down

0 comments on commit 91a2968

Please sign in to comment.