test(cometbft-rpc): add serde vectors for remaining rpc responses#5477
Open
DogInfantry wants to merge 1 commit into
Open
test(cometbft-rpc): add serde vectors for remaining rpc responses#5477DogInfantry wants to merge 1 commit into
DogInfantry wants to merge 1 commit into
Conversation
Cover the previously untested response types with fixtures captured from public union, babylon, and osmosis RPCs: abci_info, abci_query, block, block_results, block_search, blockchain, commit, header, tx, and tx_search. Small responses assert full typed equality (following the existing validators/status vectors); the larger structural responses use a new `ensure_roundtrip` helper that deserializes, re-serializes, and re-deserializes to verify lossless serde without hand-transcribing every field. broadcast_tx_sync cannot be captured from a public RPC (it requires broadcasting a signed tx), so its vector is hand-crafted for a success response. Closes unionlabs#2969
|
@DogInfantry is attempting to deploy a commit to the unionbuild Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2969
Adds serde test vectors for the
cometbft-rpcresponse types that were previously untested. Fixtures are captured from public RPCs of union, babylon, and osmosis (as requested in the issue), one block height per chain.Coverage
New vectors for:
abci_info,abci_query,block,block_results,block_search,blockchain,commit,header,tx,tx_search(×3 chains each), plusbroadcast_tx_sync.Assertion style
abci_info,broadcast_tx_sync) assert full typed equality, matching the existingvalidators/statusvectors.ensure_roundtriphelper (deserialize → re-serialize → re-deserialize →assert_eq), which verifies lossless serde without hand-transcribing thousands of lines of block/tx data.Notes
broadcast_tx_synccan't be captured from a public RPC (it requires broadcasting a signed tx), so its vector is hand-crafted for a success (code: 0) response.deny_unknown_fieldstypes — no type changes were needed.cargo test -p cometbft-rpc→ 33 passed.