Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rpc][structured-error-handling][2/n] State trait for AuthorityState,…
… group AuthorityState-originating SuiErrors (#12933) ## Description Part of the first set of PRs is to group the errors that are possible on the RPC today into a few categories transparently, setting us up to eventually standardize error strings and resolution. This PR specifically introduces a `State` trait which `AuthorityState` implements to centralize `AuthorityState`-originating `SuiError`s so that we can disambiguate these errors from other sources of `SuiError`. This has the added benefit of helping w/ unit test writing, as demonstrated by `coin_api` and `move_utils`. No change has been made to error strings, but StateReadError::Internal will now code to `-32603` instead of `-32000`. But this can be negotiable too. ## Test Plan Existing tests --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] protocol change - [x] user-visible impact - [x] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes Internal errors that arise while reading from authority will now return -32603 error code. Client-fault errors that arise while reading from authority will now return -32602 error code. Error strings have not been modified.
- Loading branch information