Skip to content

Commit

Permalink
Fix receipt gas price when effectiveGasPrice is 0 on testnets (#4014).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Apr 28, 2023
1 parent f2fb8b5 commit 2b0fe61
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src.ts/providers/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,13 @@ export class TransactionReceipt implements TransactionReceiptParams, Iterable<Lo
return new Log(log, provider);
}));

let gasPrice = BN_0;
if (tx.effectiveGasPrice != null) {
gasPrice = tx.effectiveGasPrice;
} else if (tx.gasPrice != null) {
gasPrice = tx.gasPrice;
}

defineProperties<TransactionReceipt>(this, {
provider,

Expand All @@ -623,7 +630,7 @@ export class TransactionReceipt implements TransactionReceiptParams, Iterable<Lo

gasUsed: tx.gasUsed,
cumulativeGasUsed: tx.cumulativeGasUsed,
gasPrice: ((tx.effectiveGasPrice || tx.gasPrice) as bigint),
gasPrice,

type: tx.type,
//byzantium: tx.byzantium,
Expand Down

0 comments on commit 2b0fe61

Please sign in to comment.