Skip to content

Commit

Permalink
ignore CallPhaseReverted errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Oct 15, 2024
1 parent f4cecc2 commit 328c7bc
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/cli/customTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import {
Hex
} from "viem"
import { formatAbiItem, rpc } from "viem/utils"
import { EntryPointV06Abi } from "../types/contracts"
import {
EntryPointV06Abi,
EntryPointV06SimulationsAbi
} from "../types/contracts"

export type RpcRequest = {
jsonrpc?: "2.0" | undefined
Expand Down Expand Up @@ -48,6 +51,16 @@ const FAILED_OP_SELECTOR = toFunctionSelector(
)
)

// custom selector for when code overrides are used.
const CALLPHASE_REVERTED_SELECTOR = toFunctionSelector(
formatAbiItem(
getAbiItem({
abi: EntryPointV06SimulationsAbi,
name: "CallPhaseReverted"
})
)
)

export function customTransport(
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
url_: string,
Expand Down Expand Up @@ -96,7 +109,8 @@ export function customTransport(
[
EXECUTION_RESULT_SELECTOR,
VALIDATION_RESULT_SELECTOR,
FAILED_OP_SELECTOR
FAILED_OP_SELECTOR,
CALLPHASE_REVERTED_SELECTOR
].includes(errorSelector as Hex)
) {
loggerFn = logger.info.bind(logger)
Expand Down

0 comments on commit 328c7bc

Please sign in to comment.