Skip to content

Commit 1caabe9

Browse files
committed
parse l1FeeScalar as float
1 parent 8d7d9b0 commit 1caabe9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

evm/evm-normalization/src/mapping.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ function mapTransaction(src: rpc.Transaction, receipt?: rpc.Receipt): Transactio
439439
l1BlobBaseFee: receipt?.l1BlobBaseFee ?? undefined,
440440
l1BlobBaseFeeScalar: receipt?.l1BlobBaseFeeScalar ? qty2Int(receipt.l1BlobBaseFeeScalar) : undefined,
441441
l1Fee: receipt?.l1Fee ?? undefined,
442-
l1FeeScalar: receipt?.l1FeeScalar ? parseInt(receipt.l1FeeScalar) : undefined,
442+
l1FeeScalar: receipt?.l1FeeScalar ? toFloat(receipt.l1FeeScalar) : undefined,
443443
l1GasPrice: receipt?.l1GasPrice ?? undefined,
444444
l1GasUsed: receipt?.l1GasUsed ?? undefined,
445445
}
@@ -631,3 +631,10 @@ function isEmpty(obj: object): boolean {
631631
}
632632
return true
633633
}
634+
635+
636+
function toFloat(val: string) {
637+
let float = parseFloat(val)
638+
assert(!Number.isNaN(float))
639+
return float
640+
}

0 commit comments

Comments
 (0)