Skip to content

test(cometbft-rpc): add serde vectors for remaining rpc responses#5477

Open
DogInfantry wants to merge 1 commit into
unionlabs:mainfrom
DogInfantry:test/cometbft-rpc-serde-vectors
Open

test(cometbft-rpc): add serde vectors for remaining rpc responses#5477
DogInfantry wants to merge 1 commit into
unionlabs:mainfrom
DogInfantry:test/cometbft-rpc-serde-vectors

Conversation

@DogInfantry

Copy link
Copy Markdown

Closes #2969

Adds serde test vectors for the cometbft-rpc response 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), plus broadcast_tx_sync.

Assertion style

  • Small responses (abci_info, broadcast_tx_sync) assert full typed equality, matching the existing validators/status vectors.
  • Large structural responses use a new ensure_roundtrip helper (deserialize → re-serialize → re-deserialize → assert_eq), which verifies lossless serde without hand-transcribing thousands of lines of block/tx data.

Notes

  • broadcast_tx_sync can'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.
  • All three chains' real responses deserialize cleanly under the existing deny_unknown_fields types — no type changes were needed.

cargo test -p cometbft-rpc → 33 passed.

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
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

@DogInfantry is attempting to deploy a commit to the unionbuild Team on Vercel.

A member of the Team first needs to authorize it.

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.

cometbft-rpc serde tests

1 participant