Skip to content

Commit 7e56cf8

Browse files
committed
fix: correct 0x usage
1 parent 9aa6fd5 commit 7e56cf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/viem/proofsHelpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ export const prepareBLockRLP = (
4545
'0x', //toHex(rawBlock.difficulty),
4646
toHex(rawBlock.number || 0), // 0 to account for type null
4747
toHex(rawBlock.gasLimit),
48-
toHex(rawBlock.gasUsed),
48+
rawBlock.gasUsed === 0n ? '0x' : toHex(rawBlock.gasUsed),
4949
toHex(rawBlock.timestamp),
5050
rawBlock.extraData,
5151
rawBlock.mixHash,
5252
rawBlock.nonce as Hex,
5353
toHex(rawBlock.baseFeePerGas || 0), // 0 to account for type null
5454
rawBlock.withdrawalsRoot as Hex,
5555
// @ts-ignore
56-
rawBlock.blobGasUsed === '0x0' ? '0x' : toHex(rawBlock.blobGasUsed),
56+
rawBlock.blobGasUsed === 0n ? '0x' : toHex(rawBlock.blobGasUsed),
5757
// @ts-ignore
58-
rawBlock.excessBlobGas === '0x0' ? '0x' : toHex(rawBlock.excessBlobGas),
58+
rawBlock.excessBlobGas === 0n ? '0x' : toHex(rawBlock.excessBlobGas),
5959
rawBlock.parentBeaconBlockRoot,
6060
rawBlock.requestsHash,
6161
];

0 commit comments

Comments
 (0)