Skip to content

Commit

Permalink
🥅 server: catch op-sepolia missing weth underlying
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzdanilo committed Oct 18, 2024
1 parent a4802a4 commit fc6969b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion server/hooks/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ import { Kind, parse, visit, type StringValueNode } from "graphql";
import { Hono } from "hono";
import { setTimeout } from "node:timers/promises";
import * as v from "valibot";
import { BaseError, ContractFunctionRevertedError, decodeEventLog, encodeErrorResult } from "viem";
import {
BaseError,
CallExecutionError,
ContractFunctionRevertedError,
decodeEventLog,
encodeErrorResult,
ExecutionRevertedError,
} from "viem";
import { optimism, optimismSepolia } from "viem/chains";

import { headerValidator, jsonValidator, webhooksKey } from "../utils/alchemy";
Expand Down Expand Up @@ -181,6 +188,14 @@ function scheduleWithdraw(message: string) {
}
parent.setStatus({ code: 2, message: "failed_precondition" });
captureException(error);
if (
chain.id === optimismSepolia.id &&
error instanceof BaseError &&
error.cause instanceof CallExecutionError &&
error.cause.cause instanceof ExecutionRevertedError
) {
return redis.zrem("withdraw", message);
}
}),
),
),
Expand Down

0 comments on commit fc6969b

Please sign in to comment.