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

protocols/horizon: Change JSON response from int64 to string in multiple places. #2021

Merged
merged 8 commits into from
Jan 20, 2020

Conversation

abuiles
Copy link
Contributor

@abuiles abuiles commented Dec 6, 2019

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with name of package that is most changed in the PR, ex.
    services/friendbot, or all or doc if the changes are broad or impact many
    packages.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated any docs (developer docs, .md
    files, etc... affected by this change). Take a look in the docs folder for a given service,
    like this one.

Release planning

  • I've updated the relevant CHANGELOG (here for Horizon) if
    needed with deprecations, added features, breaking changes, and DB schema changes.
  • I've decided if this PR requires a new major/minor version according to
    semver, or if it's mainly a patch change. The PR is targeted at the next
    release branch if it's not a patch change.

What

Change the type for multiple JSON fields using int64 to be of type string:

Why

As discussed in the following issues: #1609, #1363 -- we should be using string for int64 values since it leads to data getting lost when using JS.

Known limitations

  • N/A

TODO

Update branch once fee deprecation has been merge in 0.25.0 release

@cla-bot cla-bot bot added the cla: yes label Dec 6, 2019
@abuiles abuiles changed the title protocols/horizon: Change JSON response from int64 to string in multiple fixes. protocols/horizon: Change JSON response from int64 to string in multiple places. Dec 9, 2019
@abuiles abuiles force-pushed the deprecate-fee-stats-data branch from 39df62a to 86e6564 Compare January 16, 2020 16:16
@abuiles abuiles changed the base branch from deprecate-fee-stats-data to release-horizon-v0.25.0 January 16, 2020 19:57
@abuiles abuiles force-pushed the int64-string branch 2 times, most recently from 041617b to bd38a6c Compare January 16, 2020 20:29
@@ -261,6 +261,21 @@ type Effect struct {
DetailsString null.String `db:"details"`
}

// TradeEffectDetails is a struct of data from `effects.DetailsString`
// when the effect type is trade
type TradeEffectDetails struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The representation for a trade effect at at db level is slightly different than the representation at the resource level. Specifically, OfferID is stored in the db as an int64.

@abuiles abuiles marked this pull request as ready for review January 16, 2020 22:04
@abuiles abuiles merged commit 2e9e667 into release-horizon-v0.25.0 Jan 20, 2020
@abuiles abuiles deleted the int64-string branch January 24, 2020 17:10
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.

3 participants