-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added read and write methods from schema registry into SDK
- Loading branch information
1 parent
8b1edf9
commit 1a7a1e9
Showing
4 changed files
with
199 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { BaseError, ContractFunctionRevertedError } from "viem"; | ||
|
||
export function handleError(err: unknown): never { | ||
if (err instanceof BaseError) { | ||
const revertError = err.walk((err) => err instanceof ContractFunctionRevertedError); | ||
if (revertError instanceof ContractFunctionRevertedError) { | ||
const errorName = revertError.data?.errorName ?? ""; | ||
console.error(`Failing with ${errorName}`); | ||
} | ||
} | ||
console.error(err); | ||
|
||
throw new Error("Simulation failed"); | ||
} |