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

fix(x/bank): Better handling of negative spendable balances #21407

Merged
merged 10 commits into from
Sep 10, 2024

Commits on Aug 23, 2024

  1. Update the SpendableBalances query endpoint function. Now, it'll bene…

    …fit from the pagination by subtracting locked coins instead of selecting the desired entries out of the k.SpendableCoins results. That k.SpendableCoins method first gets all balances, then subtracts the locked coins. So this query was effectively getting all balances every time instead of only info on the current page's entries.
    SpicyLemon committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    6b00b93 View commit details
    Browse the repository at this point in the history
  2. Update the SpendableCoins view keeper method to better handle when on…

    …e denom is negative; now it'll treat just that one as zero instead of the entire spendable balance. Also update SpendableCoin to not panic when there's more locked than available; just return a zero coin in that case.
    SpicyLemon committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    49a7712 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2024

  1. Add some unit tests that hit the spendable balance edge cases (and wo…

    …uld fail without this change).
    SpicyLemon committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    ff781b5 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

  1. Configuration menu
    Copy the full SHA
    f5043dd View commit details
    Browse the repository at this point in the history
  2. Add changelog entries.

    SpicyLemon committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    04fd051 View commit details
    Browse the repository at this point in the history
  3. Fix a variable name in the keeper test that I accidentally added a ch…

    …ar to when not looking.
    SpicyLemon committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    e2b125c View commit details
    Browse the repository at this point in the history
  4. Fix the integration test on SpendableBalances that broke because the …

    …gas cost went down with this change.
    SpicyLemon committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    350c21b View commit details
    Browse the repository at this point in the history
  5. Clarify a changelog entry.

    SpicyLemon committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    d0afa21 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. Configuration menu
    Copy the full SHA
    b99cf6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b474a6 View commit details
    Browse the repository at this point in the history