Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore CallPhaseReverted errors #329

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading