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

Copy the spendable-balances cli query command from upstream v0.47.x. #580

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

SpicyLemon
Copy link

Description

This PR brings in the spendable-balances from v0.47 of the SDK.

v0.46 of the SDK already has the SpendableBalances grpc query endpoint, just not the CLI command for it.

v0.47 has the CLI command, but also has a SpendableBalancesByDenom query that isn't yet in our version of the SDK. The CLI command has a --denom flag that, if provided uses the denom-specific version of the query instead of the one for all balances. So the version of the command in this PR is a little different from the v0.47 version of the command because I had to remove that denom-specific functionality.

For reference, here's the SDK's version which I copied/tweaked: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/x/bank/client/cli/query.go#L112-L170

I didn't bring over any unit tests for it because v0.47 included a massive overhaul to how tests are done, and they couldn't be easily copy/pasted/fixed.

I did, however, wire this up to a local version of the provenance repo, and added some unit tests in there dealing with the escrow module, making sure that things in escrow are removed from the spendable balances.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@SpicyLemon SpicyLemon merged commit d08d4c2 into main-pio Jul 31, 2023
SpicyLemon added a commit that referenced this pull request Aug 11, 2023
…, Locked Coins No Delegate (#582) (#584)

* Copy the spendable-balances cli query command from upstream v0.47.x. (#580)

* Allow MsgMultiSend to have multiple inputs when there's only one output. (#581)

* Update InputOutput coins to allow multiple senders if there's a single receiver. So it's one-to-one, one-to-many, or many-to-one, but not many-to-many.

* Add changelog entry.

* Prevent locked coins from being delegated. (#582)

* [1607]: Move the UnvestedCoins GetLockedCoinsFn to its own file.

* [1607]: Add the ability to bypass the vesting locked coins function.

* [1607]: Rename the bypass funcs to include vesting since it's in the types package in the bank module, so it's not as clear as the others.

* [1607]: Pay attention to locked coins in DelegateCoins too, but bypass the vesting locked coins funciton since it's purposfully not applied there. But we want the other locked coins stuff to still go.

* [1607]: Add unit tests on the locked coins behaviors.

* [1607]: Put the UnvestedCoins function back in view.go and get rid of the locked_coins.go file.

* [1607]: Add changelog entry.

* [1607]: Fix use of InputOutputCoins after merge.

* [1607]: Make SimulateFromSeed return the last block time used so restarted stuff can pretend to be at that time too.

* [1607]: Use SpendableCoins with vesting bypass for the staking simulation operations.

* [1607]: Fix a bank test that was failing because I changed an error message.

* [1607]: Fix the staking simulation operations to properly handle funds locked outside of vesting.

* [1607]: Fix the test-sim-benchmark-invariants make target.

* [1607]: Update the changelog.

* Add changelog entry for 580.
@SpicyLemon SpicyLemon deleted the prov/dwedul/cli-spendable-query branch December 17, 2024 18:48
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.

2 participants