chore: Deserialize data field of broadcast tx response as hex bytes#110
Merged
chore: Deserialize data field of broadcast tx response as hex bytes#110
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the data field for broadcast transaction responses to be deserialized as raw hex bytes rather than base64 strings.
- Test fixtures for v0.34 and v0.38 now include a sample hex-encoded
datavalue. - Test assertions have been updated to decode and compare the new hex data.
- The serde serializer on
tx_syncandtx_asyncresponses was switched tohexstring, and the hexstring deserializer was generalized to anyFrom<Vec<u8>>type. - A changelog entry documents the bug fix.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_sync.json | Updated data fixture to a hex string |
| rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_async.json | Updated data fixture to a hex string |
| rpc/tests/kvstore_fixtures/v0_38.rs | Added assert_eq decoding hex for data in both sync and async tests |
| rpc/tests/kvstore_fixtures/v0_34/incoming/broadcast_tx_sync.json | Updated data fixture to a hex string |
| rpc/tests/kvstore_fixtures/v0_34/incoming/broadcast_tx_async.json | Updated data fixture to a hex string |
| rpc/tests/kvstore_fixtures/v0_34.rs | Added assert_eq decoding hex and inline comments |
| rpc/src/endpoint/broadcast/tx_sync.rs | Changed serde data field to use hexstring serializer |
| rpc/src/endpoint/broadcast/tx_async.rs | Changed serde data field to use hexstring serializer |
| proto/src/serializers/bytes.rs | Expanded hexstring deserializer to generic T |
| .changelog/unreleased/bug-fixes/62-result-broadcast.md | Added bug-fix description |
Comments suppressed due to low confidence (1)
proto/src/serializers/bytes.rs:10
- The doc comment is now misleading since the function returns a generic
T: From<Vec<u8>>instead of specificallyVec<u8>. Consider updating the comment to reflect the return type flexibility.
/// Deserialize a hex-encoded string into `Vec<u8>`
rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_sync.json
Outdated
Show resolved
Hide resolved
rpc/tests/kvstore_fixtures/v0_34/incoming/broadcast_tx_sync.json
Outdated
Show resolved
Hide resolved
greg-szabo
approved these changes
Jun 18, 2025
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.
Port-of: cometbft/tendermint-rs#1501
Closes #62