Skip to content

Commit

Permalink
Merge pull request #205 from pimlicolabs/fix/waitForUserOperationReceipt
Browse files Browse the repository at this point in the history
Fix logs type for receipts
  • Loading branch information
plusminushalf authored May 13, 2024
2 parents 2fc04df + 5fa31f2 commit 5125325
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/light-mangos-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"permissionless": patch
---

Made type of waitForUserOperationReceipt.logs consistent with Log from viem
19 changes: 6 additions & 13 deletions packages/permissionless/actions/bundler/getUserOperationReceipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
Client,
Hash,
Hex,
Log,
Transport
} from "viem"
import type { BundlerClient } from "../../clients/createBundlerClient"
Expand Down Expand Up @@ -42,16 +43,7 @@ export type GetUserOperationReceiptReturnType = {
logsBloom: Hex
effectiveGasPrice: bigint
}
logs: {
data: Hex
blockNumber: bigint
blockHash: Hash
transactionHash: Hash
logIndex: bigint
transactionIndex: bigint
address: Address
topics: Hex[]
}[]
logs: Log[]
}

/**
Expand Down Expand Up @@ -123,10 +115,11 @@ export const getUserOperationReceipt = async <
blockNumber: BigInt(log.blockNumber),
blockHash: log.blockHash,
transactionHash: log.transactionHash,
logIndex: BigInt(log.logIndex),
transactionIndex: BigInt(log.transactionIndex),
logIndex: Number(log.logIndex),
transactionIndex: Number(log.transactionIndex),
address: log.address,
topics: log.topics
topics: log.topics,
removed: log.removed
}))
}

Expand Down
3 changes: 2 additions & 1 deletion packages/permissionless/types/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ type UserOperationReceiptWithBigIntAsHex = {
logIndex: Hex
transactionIndex: Hex
address: Address
topics: Hex[]
topics: [Hex, ...Hex[]] | []
removed: boolean
}[]
}

Expand Down

0 comments on commit 5125325

Please sign in to comment.