Skip to content

Commit

Permalink
fix: TransactionReceipt Returns null for l1tol2logs in abs chain (
Browse files Browse the repository at this point in the history
#3004)

* fix: transaction receipt formatter

* Fix logType

* Create angry-cars-poke.md

---------

Co-authored-by: jxom <7336481+jxom@users.noreply.github.com>
  • Loading branch information
atarpara and jxom authored Nov 19, 2024
1 parent 7771d44 commit 0c98d99
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-cars-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

**ZKsync:** Fixed `TransactionReceipt` formatter & type.
2 changes: 1 addition & 1 deletion src/zksync/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/types/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c98d99

Please sign in to comment.