Skip to content

Commit

Permalink
feat: update l1GasWithScalar
Browse files Browse the repository at this point in the history
  • Loading branch information
ponyjackal committed Feb 7, 2024
1 parent 2bb7080 commit 3b90d7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transformers/ethereum/fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export function transform(block: RawBlock): RawBlock {
block.transactions = block.transactions.map((tx) => {
let totalL2FeeWei = BigInt(0);
if (tx.gasPrice) {
const l2GasPrice = BigInt(tx.gasPrice);
const l2GasUsed = BigInt(tx.receipt.gasUsed);
const l2GasPrice = BigInt(tx.gasPrice ?? 0);
const l2GasUsed = BigInt(tx.receipt.gasUsed ?? 0);

const l2Gas = l2GasPrice * l2GasUsed;

Expand All @@ -14,7 +14,7 @@ export function transform(block: RawBlock): RawBlock {

const l1GasWithoutScalar = l1GasPrice * l1GasUsed;

const scalar = Number(tx.receipt.l1FeeScalar);
const scalar = Number(tx.receipt.l1FeeScalar ?? 0);
const l1GasWithoutScalarAsNumber = Number(l1GasWithoutScalar);
const l1GasWithScalar = l1GasWithoutScalarAsNumber * scalar;

Expand Down

0 comments on commit 3b90d7e

Please sign in to comment.