Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode claimable balance ids to match Horizon in JSON #368

Merged
merged 4 commits into from
May 14, 2024
Merged

Conversation

leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented May 13, 2024

What

Encode claimable balance ids to match Horizon in JSON

Why

Claimable balances are rendered as a hex string contained in an object with the v0 discriminant.

In Horizon, claimable balance IDs are rendered by hex encoding the XDR for the object structure.

Given that folks are used to the Horizon rendering, we should use that in the JSON <> XDR as well.

Close #367

@leighmcculloch leighmcculloch marked this pull request as ready for review May 13, 2024 03:35
@leighmcculloch leighmcculloch requested a review from dmkozh May 13, 2024 03:37
@leighmcculloch
Copy link
Member Author

I'd like to merge this change to accompany #347 and #360, and release them all in a minor release. However, since this change changes the JSON format, it is a breaking change.

We've always said internally that the JSON format was experimental and unstable, but never actually said that in the docs for the crate. In any case it's pretty important not to introduce a breaking change into the JSON anywhere it'd cause the CLI to break with data it caches to disk.

Given claimable balances don't overlap with Soroban usage at all and the only CLI usage is for Soroban only txs, it's probably an extremely low likelihood and low impact change to make.

cc @accordeiro @dmkozh @quietbits

@leighmcculloch leighmcculloch added this pull request to the merge queue May 14, 2024
Merged via the queue into main with commit 204ccb8 May 14, 2024
10 checks passed
@leighmcculloch leighmcculloch deleted the i367 branch May 14, 2024 01:18
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.

Render claimable balance IDs in the same format that Horizon renders them in
2 participants