Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless-eth committed May 30, 2024
1 parent 03e75b0 commit a1f66a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/executor/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from "@alto/types"
import type { Logger } from "@alto/utils"
import {
getRevertErrorData,
isVersion06,
parseViemError,
toPackedUserOperation,
Expand All @@ -39,7 +40,6 @@ import {
hexToBytes,
numberToHex
} from "viem"
import { getRevertErrorData } from "viem/_types/actions/public/call"

export function simulatedOpsToResults(
simulatedOps: {
Expand Down
14 changes: 13 additions & 1 deletion src/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { type Address, getAddress } from "viem"
import {
type Address,
getAddress,
BaseError,
type RawContractError
} from "viem"

/// Ensure proper equality by converting both addresses into their checksum type
export const areAddressesEqual = (a: Address, b: Address) => {
return getAddress(a) === getAddress(b)
}

export function getRevertErrorData(err: unknown) {
// biome-ignore lint/style/useBlockStatements:
if (!(err instanceof BaseError)) return undefined
const error = err.walk() as RawContractError
return typeof error?.data === "object" ? error.data?.data : error.data
}

0 comments on commit a1f66a2

Please sign in to comment.