diff --git a/src/cli/customTransport.ts b/src/cli/customTransport.ts index 7a30b201..49aa1f16 100644 --- a/src/cli/customTransport.ts +++ b/src/cli/customTransport.ts @@ -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 @@ -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, @@ -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)