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

services/horizon: Issue #3476, Include claimable balances in asset stats summaries #3502

Merged
merged 20 commits into from
Apr 1, 2021

Conversation

paulbellamy
Copy link
Contributor

@paulbellamy paulbellamy commented Mar 26, 2021

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

Fixes #3476.

Add accounts.claimable_balances, and balances.claimable_balances summary fields to /assets.

Why

See: #3476

Known limitations

[TODO or N/A]

Copy link
Contributor

@bartekn bartekn left a comment

Choose a reason for hiding this comment

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

LGTM! Please check the comment in protocols. I'm not sure if we should add claimable_balances under accounts.

protocols/horizon/main.go Outdated Show resolved Hide resolved
services/horizon/CHANGELOG.md Outdated Show resolved Hide resolved
Unauthorized: a.Unauthorized + b.Unauthorized,
}
}

func (a ExpAssetStatAccounts) IsZero() bool {
return a.Authorized == 0 && a.AuthorizedToMaintainLiabilities == 0 && a.Unauthorized == 0
return a == ExpAssetStatAccounts{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated to this PR: does Exp stand for experimental? If so, I think it's about time to remove it.

Copy link
Contributor Author

@paulbellamy paulbellamy Mar 31, 2021

Choose a reason for hiding this comment

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

It seems like db2 and history are both misnomers as well, given there's only one db, and two "sections" (for lack of a better term) within it, the normal (current? state?) tables and history_* tables.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should try to change exp_asset_stats table name too? Not sure how complicated it is.

@paulbellamy paulbellamy merged commit 339647f into master Apr 1, 2021
@paulbellamy paulbellamy deleted the 3476/asset-stats-claimable-balances branch April 1, 2021 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.

Include claimable balances in Asset Stats endpoint
4 participants