Skip to content

fix: add typed contract revert errors - #163

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
silentgeckoaudit3801:fix/typed-contract-revert-errors-148
Jul 30, 2026
Merged

fix: add typed contract revert errors#163
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
silentgeckoaudit3801:fix/typed-contract-revert-errors-148

Conversation

@silentgeckoaudit3801

Copy link
Copy Markdown
Contributor

Closes #148.

Summary

  • add ContractRevertError with reason, rawData, rpcCode, and optional decoded custom error metadata
  • re-export the typed transaction errors from errors/index.ts
  • make RpcProvider throw ContractRevertError for JSON-RPC contract reverts instead of a generic WhiteChainError
  • cover instanceof discrimination and revert metadata in focused tests

Validation

  • git diff --check
  • rg -n "ContractRevertError|extractRevertReason|isContractRevertError|rawData|rpcCode" src tests
  • attempted vitest run tests/providers/RpcProvider.test.ts tests/errors.test.ts, but the existing checkout's node_modules is missing Rollup's optional native package @rollup/rollup-win32-x64-msvc; I did not install dependencies

@Lakes41
Lakes41 merged commit d05ec35 into Adamantine-guild:main Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Typed Error handling for RPC and contract reverts

2 participants