starknet_transaction_prover: make RPC error spec test exhaustive via enum - #14051
starknet_transaction_prover: make RPC error spec test exhaustive via enum#14051avi-starkware wants to merge 1 commit into
Conversation
PR SummaryLow Risk Overview The OpenRPC conformance test
Reviewed by Cursor Bugbot for commit d3ef343. Bugbot is set up for automated code reviews on this repo. Configure here. |
b062874 to
1d6f06e
Compare
3457808 to
ac2d30f
Compare
1d6f06e to
6377a5b
Compare
ac2d30f to
cb3ebef
Compare
6377a5b to
6a4087a
Compare
cb3ebef to
93accf4
Compare
6a4087a to
44827d2
Compare
93accf4 to
dd1dfa1
Compare
|
There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. |
02903ed to
e61d300
Compare
dd1dfa1 to
030f59e
Compare
e61d300 to
a1deacf
Compare
6cd4efd to
affd486
Compare
a1deacf to
53eac05
Compare
b3125c8 to
6883b3f
Compare
380e332 to
3f1a1f0
Compare
3f1a1f0 to
7178327
Compare
6883b3f to
366b359
Compare
7178327 to
51b6a7b
Compare
366b359 to
4bf0ce3
Compare
…enum Replaces the ad-hoc test_cases vec in test_error_responses_match_spec with a KnownRpcError test-only enum whose spec_key and sample_error_object matches are exhaustive — adding a new variant forces both matches to be updated, and the bidirectional set-equality check between KnownRpcError::ALL and the spec's components/errors keys guarantees the enum and the OpenRPC spec stay in sync. Drops the pre-existing 'TODO(Avi): Add an error enum to make this test exhaustive' tag.
51b6a7b to
f0d3ede
Compare
4bf0ce3 to
d3ef343
Compare

Replaces the ad-hoc
test_casesvec intest_error_responses_match_specwith aServiceErrorCodeenum whosespec_keyandsample_error_objectmatches areexhaustive: adding a variant fails to compile until both are updated, and the
bidirectional set-equality check between the enum and the spec's
components/errorskeys fails until the OpenRPC spec documents it.Each error's code and canonical message now live in one place, with the
constructor functions as thin wrappers.
strumis a dev-dependency andEnumIteris derived under#[cfg(test)]: theiteration exists only for the test, so it does not belong in the shipped
binary's dependency graph.
Drops the pre-existing
TODO(Avi): Add an error enum to make this test exhaustive.