From 0c98d991b5ec6990251486d860349718f8e7ea04 Mon Sep 17 00:00:00 2001 From: Akshay Tarpara Date: Tue, 19 Nov 2024 09:32:37 +0530 Subject: [PATCH] fix: `TransactionReceipt` Returns `null` for `l1tol2logs` in abs chain (#3004) * fix: transaction receipt formatter * Fix logType * Create angry-cars-poke.md --------- Co-authored-by: jxom <7336481+jxom@users.noreply.github.com> --- .changeset/angry-cars-poke.md | 5 +++++ src/zksync/formatters.ts | 2 +- src/zksync/types/log.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/angry-cars-poke.md diff --git a/.changeset/angry-cars-poke.md b/.changeset/angry-cars-poke.md new file mode 100644 index 0000000000..d5c50c3e3a --- /dev/null +++ b/.changeset/angry-cars-poke.md @@ -0,0 +1,5 @@ +--- +"viem": patch +--- + +**ZKsync:** Fixed `TransactionReceipt` formatter & type. diff --git a/src/zksync/formatters.ts b/src/zksync/formatters.ts index aeff174c70..f4857ffc80 100644 --- a/src/zksync/formatters.ts +++ b/src/zksync/formatters.ts @@ -81,7 +81,7 @@ export const formatters = { return { blockNumber: hexToBigInt(l2ToL1Log.blockHash), blockHash: l2ToL1Log.blockHash, - l1BatchNumber: hexToBigInt(l2ToL1Log.l1BatchNumber), + l1BatchNumber: l2ToL1Log.l1BatchNumber ? hexToBigInt(l2ToL1Log.l1BatchNumber) : null, transactionIndex: hexToBigInt(l2ToL1Log.transactionIndex), shardId: hexToBigInt(l2ToL1Log.shardId), isService: l2ToL1Log.isService, diff --git a/src/zksync/types/log.ts b/src/zksync/types/log.ts index a8345492af..f22db6721b 100644 --- a/src/zksync/types/log.ts +++ b/src/zksync/types/log.ts @@ -45,7 +45,7 @@ export type ZksyncL2ToL1Log = { export type ZksyncRpcL2ToL1Log = { blockNumber: Hex blockHash: Hex - l1BatchNumber: Hex + l1BatchNumber: Hex | null transactionIndex: Hex shardId: Hex isService: boolean