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

GRPC querier init and bank #5882

Closed

Conversation

aaronc
Copy link
Member

@aaronc aaronc commented Mar 27, 2020

Closes: #XXX

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@lgtm-com
Copy link

lgtm-com bot commented Mar 28, 2020

This pull request introduces 1 alert when merging 30fc2a59b95b9587ffa126d89cbf871b40f8563f into 77dd247 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

if err != nil {
return err
}
resBz, err := querier(q.ctx, path[2:], abci.RequestQuery{Data: reqBz})
Copy link
Contributor

Choose a reason for hiding this comment

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

ineffectual assignment to err (from ineffassign)

@@ -1,6 +1,9 @@
package types

import "regexp"
import (
"google.golang.org/grpc"
Copy link
Contributor

Choose a reason for hiding this comment

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

File is not goimports-ed (from goimports)

Suggested change
"google.golang.org/grpc"

abci "github.com/tendermint/tendermint/abci/types"

"github.com/cosmos/cosmos-sdk/codec"
"context"
Copy link
Contributor

Choose a reason for hiding this comment

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

File is not goimports-ed (from goimports)

Suggested change
"context"
"context"

"google.golang.org/grpc"
"google.golang.org/grpc/encoding"
"google.golang.org/grpc/encoding/proto"
"strings"
Copy link
Contributor

Choose a reason for hiding this comment

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

File is not goimports-ed (from goimports)

Suggested change
"strings"

if denom == "" {
var balances sdk.Coins
if err := m.UnmarshalJSON(res, &balances); err != nil {
params := &types.QueryAllBalancesParams{addr}
Copy link
Contributor

Choose a reason for hiding this comment

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

composites: github.com/cosmos/cosmos-sdk/x/bank/types.QueryAllBalancesParams composite literal uses unkeyed fields (from govet)

} else {
var balance sdk.Coin
if err := m.UnmarshalJSON(res, &balance); err != nil {
params := &types.QueryBalanceParams{addr, denom}
Copy link
Contributor

Choose a reason for hiding this comment

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

composites: github.com/cosmos/cosmos-sdk/x/bank/types.QueryBalanceParams composite literal uses unkeyed fields (from govet)

return bz, nil
func (q Querier) QueryAllBalances(ctx context.Context, params *types.QueryAllBalancesParams) (*types.QueryAllBalancesResponse, error) {
balances := q.GetAllBalances(sdk.UnwrapSDKContext(ctx), params.Address)
return &types.QueryAllBalancesResponse{balances}, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

composites: github.com/cosmos/cosmos-sdk/x/bank/types.QueryAllBalancesResponse composite literal uses unkeyed fields (from govet)

x/bank/module.go Outdated
@@ -77,6 +78,10 @@ type AppModule struct {
accountKeeper types.AccountKeeper
}

func (am AppModule) RegisterQueryServer(server grpc.Server) {
types.RegisterQueryServer(server, keeper.Querier{am.keeper})
Copy link
Contributor

Choose a reason for hiding this comment

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

composites: github.com/cosmos/cosmos-sdk/x/bank/keeper.Querier composite literal uses unkeyed fields (from govet)

@lgtm-com
Copy link

lgtm-com bot commented Mar 30, 2020

This pull request introduces 1 alert when merging 6a871458bec647f046473d0aa1064029214159b4 into 2a7a408 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@codecov
Copy link

codecov bot commented Mar 30, 2020

Codecov Report

Merging #5882 into master will increase coverage by 0.27%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #5882      +/-   ##
==========================================
+ Coverage   56.50%   56.78%   +0.27%     
==========================================
  Files         342      342              
  Lines       20278    20047     -231     
==========================================
- Hits        11459    11383      -76     
+ Misses       7971     7815     -156     
- Partials      848      849       +1     

@aaronc aaronc force-pushed the aaronc/grpc-querier-bank-init branch from 6a87145 to 1c6b0b3 Compare April 8, 2020 00:47
@lgtm-com
Copy link

lgtm-com bot commented Apr 8, 2020

This pull request introduces 1 alert when merging 1c6b0b3 into 7325692 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@aaronc aaronc mentioned this pull request Apr 8, 2020
11 tasks
@aaronc
Copy link
Member Author

aaronc commented Apr 8, 2020

Replaced by #5953 so that the branch isn't from our fork.

@aaronc aaronc closed this Apr 8, 2020
This was referenced May 13, 2020
@ryanchristo ryanchristo deleted the aaronc/grpc-querier-bank-init branch December 12, 2022 18:16
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