Skip to content

Comments

chore: Deserialize data field of broadcast tx response as hex bytes#110

Merged
melekes merged 4 commits intomainfrom
anca/1500-resultbroadcast
Jun 19, 2025
Merged

chore: Deserialize data field of broadcast tx response as hex bytes#110
melekes merged 4 commits intomainfrom
anca/1500-resultbroadcast

Conversation

@melekes
Copy link
Collaborator

@melekes melekes commented Jun 10, 2025

@melekes melekes requested review from Copilot and greg-szabo June 10, 2025 11:11
@melekes melekes self-assigned this Jun 10, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 data value.
  • Test assertions have been updated to decode and compare the new hex data.
  • The serde serializer on tx_sync and tx_async responses was switched to hexstring, and the hexstring deserializer was generalized to any From<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 specifically Vec<u8>. Consider updating the comment to reflect the return type flexibility.
/// Deserialize a hex-encoded string into `Vec<u8>`

@melekes melekes merged commit c9b4329 into main Jun 19, 2025
20 of 21 checks passed
@melekes melekes deleted the anca/1500-resultbroadcast branch June 19, 2025 17:06
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.

Port "Deserialize data field of broadcast tx response as hex bytes"

2 participants