-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat: (x/bank) add spendable balances cmd #14045
Conversation
…os/cosmos-sdk into facu/spendable-balances-cmd
I think spendableCoins uses gas more efficiently when compared to get the balance of an account multiple times after txs. |
I like @facundomedica's proposal! Why exactly do you think having a |
I'm not opposed to it and don't really think its a bad idea, but just concerned if we could remove |
…os/cosmos-sdk into facu/spendable-balances-cmd
So in other words |
I like this better |
@facundomedica well if it's a new query for just spendable balances, then |
Coming back to this after a while. I think we have to options:
If we really want to be able to get a single denom at a time, we should go for 1, if not, I would just stick with 2. |
So now the |
@facundomedica let's move this to draft mode until it's ready to review again pls. |
[Cosmos SDK] Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one comment, otherwise lgtm
can you also remove the gov expected_keeper_mocks from here and fix these failing tests ?
@@ -47,10 +43,6 @@ func (k BaseKeeper) AllBalances(ctx context.Context, req *types.QueryAllBalances | |||
return nil, status.Error(codes.InvalidArgument, "empty request") | |||
} | |||
|
|||
if req.Address == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why these removals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition is checked again using sdk.AccAddressFromBech32(req.Address)
in L46 https://github.com/cosmos/cosmos-sdk/pull/14045/files#diff-c2a808829580789ad27e7f3393b3cd63b2f61ff6df06de938cd14dfd73d01e9fR46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lef tone question but looks good otherwise
LGTM. Let's merge. |
(cherry picked from commit 6ac0c36) # Conflicts: # CHANGELOG.md
Description
This PR adds a
spendable-balances
to x/bank's queries.Questions:
balances
and activate it with a bool flag (--only-spendable
)? This would invalidate the--denom
flag. If we are ok with that, maybe it's cleaner that way.Closes: #14030
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change