Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
blushi committed Jul 3, 2020
1 parent 707e189 commit d16bd1f
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 92 deletions.
12 changes: 6 additions & 6 deletions proto/cosmos/evidence/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ service Query {
// Evidence queries evidence based on evidence hash
rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) {}

// AllEvidences queries all evidences
rpc AllEvidences(QueryAllEvidencesRequest) returns (QueryAllEvidencesResponse) {}
// AllEvidence queries all evidence
rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) {}
}

// QueryEvidenceRequest is the request type for the Query/Evidence RPC method
Expand All @@ -26,13 +26,13 @@ message QueryEvidenceResponse {
google.protobuf.Any evidence = 1;
}

// QueryEvidenceRequest is the request type for the Query/AllEvidences RPC method
message QueryAllEvidencesRequest {
// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC method
message QueryAllEvidenceRequest {
cosmos.query.PageRequest req = 1;
}

// QueryAllEvidencesResponse is the response type for the Query/AllEvidences RPC method
message QueryAllEvidencesResponse {
// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC method
message QueryAllEvidenceResponse {
repeated google.protobuf.Any evidences = 1;

cosmos.query.PageResponse res = 2;
Expand Down
1 change: 1 addition & 0 deletions store/rootmulti/internal/proofs/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"sort"

ics23 "github.com/confio/ics23/go"

sdkmaps "github.com/cosmos/cosmos-sdk/store/rootmulti/internal/maps"
)

Expand Down
2 changes: 1 addition & 1 deletion store/rootmulti/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/store/iavl"
sdkmaps "github.com/cosmos/cosmos-sdk/store/rootmulti/internal/maps"
"github.com/cosmos/cosmos-sdk/store/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
sdkmaps "github.com/cosmos/cosmos-sdk/store/rootmulti/internal/maps"
)

func TestStoreType(t *testing.T) {
Expand Down
11 changes: 6 additions & 5 deletions x/evidence/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import (
"github.com/cosmos/cosmos-sdk/store/prefix"
"github.com/cosmos/cosmos-sdk/types/query"

proto "github.com/gogo/protobuf/proto"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/evidence/exported"
"github.com/cosmos/cosmos-sdk/x/evidence/types"
proto "github.com/gogo/protobuf/proto"
)

var _ types.QueryServer = Keeper{}
Expand Down Expand Up @@ -44,8 +45,8 @@ func (k Keeper) Evidence(c context.Context, req *types.QueryEvidenceRequest) (*t
return &types.QueryEvidenceResponse{Evidence: evidenceAny}, nil
}

// AllEvidences implements the Query/AllEvidences gRPC method
func (k Keeper) AllEvidences(c context.Context, req *types.QueryAllEvidencesRequest) (*types.QueryAllEvidencesResponse, error) {
// AllEvidence implements the Query/AllEvidence gRPC method
func (k Keeper) AllEvidence(c context.Context, req *types.QueryAllEvidenceRequest) (*types.QueryAllEvidenceResponse, error) {
if req == nil {
return nil, status.Errorf(codes.InvalidArgument, "empty request")
}
Expand All @@ -71,10 +72,10 @@ func (k Keeper) AllEvidences(c context.Context, req *types.QueryAllEvidencesRequ
})

if err != nil {
return &types.QueryAllEvidencesResponse{}, err
return &types.QueryAllEvidenceResponse{}, err
}

return &types.QueryAllEvidencesResponse{Evidences: evidences, Res: res}, nil
return &types.QueryAllEvidenceResponse{Evidences: evidences, Res: res}, nil
}

// ConvertEvidence converts Evidence to Any type
Expand Down
12 changes: 6 additions & 6 deletions x/evidence/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ func (suite *KeeperTestSuite) TestQueryEvidence() {
suite.Require().NotNil(res.Evidence)
}

func (suite *KeeperTestSuite) TestQueryAllEvidences() {
func (suite *KeeperTestSuite) TestQueryAllEvidence() {
app, ctx := suite.app, suite.ctx

queryHelper := baseapp.NewQueryServerTestHelper(ctx)
types.RegisterQueryServer(queryHelper, app.EvidenceKeeper)
queryClient := types.NewQueryClient(queryHelper)

res, err := queryClient.AllEvidences(gocontext.Background(), &types.QueryAllEvidencesRequest{})
res, err := queryClient.AllEvidence(gocontext.Background(), &types.QueryAllEvidenceRequest{})
suite.Require().NoError(err)
suite.Require().NotNil(res)
suite.Require().Empty(res.Evidences)
Expand All @@ -52,8 +52,8 @@ func (suite *KeeperTestSuite) TestQueryAllEvidences() {
Limit: 50,
CountTotal: false,
}
req := types.NewQueryAllEvidencesRequest(pageReq)
res, err = queryClient.AllEvidences(gocontext.Background(), req)
req := types.NewQueryAllEvidenceRequest(pageReq)
res, err = queryClient.AllEvidence(gocontext.Background(), req)
suite.Require().NoError(err)
suite.Require().NotNil(res)
suite.Equal(len(res.Evidences), 50)
Expand All @@ -64,8 +64,8 @@ func (suite *KeeperTestSuite) TestQueryAllEvidences() {
Limit: 50,
CountTotal: true,
}
req = types.NewQueryAllEvidencesRequest(pageReq)
res, err = queryClient.AllEvidences(gocontext.Background(), req)
req = types.NewQueryAllEvidenceRequest(pageReq)
res, err = queryClient.AllEvidence(gocontext.Background(), req)
suite.Equal(len(res.Evidences), 50)
suite.Nil(res.Res.NextKey)
}
8 changes: 4 additions & 4 deletions x/evidence/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
custom = "custom"
)

func (suite *KeeperTestSuite) TestQueryEvidence_Existing() {
func (suite *KeeperTestSuite) TestQuerier_QueryEvidence_Existing() {
ctx := suite.ctx.WithIsCheckTx(false)
numEvidence := 100
cdc, _ := simapp.MakeCodecs()
Expand All @@ -35,7 +35,7 @@ func (suite *KeeperTestSuite) TestQueryEvidence_Existing() {
suite.Equal(evidence[0], e)
}

func (suite *KeeperTestSuite) TestQueryEvidence_NonExisting() {
func (suite *KeeperTestSuite) TestQuerier_QueryEvidence_NonExisting() {
ctx := suite.ctx.WithIsCheckTx(false)
cdc, _ := simapp.MakeCodecs()
numEvidence := 100
Expand All @@ -51,7 +51,7 @@ func (suite *KeeperTestSuite) TestQueryEvidence_NonExisting() {
suite.Nil(bz)
}

func (suite *KeeperTestSuite) TestQueryAllEvidence() {
func (suite *KeeperTestSuite) TestQuerier_QueryAllEvidence() {
ctx := suite.ctx.WithIsCheckTx(false)
cdc, _ := simapp.MakeCodecs()
numEvidence := 100
Expand All @@ -71,7 +71,7 @@ func (suite *KeeperTestSuite) TestQueryAllEvidence() {
suite.Len(e, numEvidence)
}

func (suite *KeeperTestSuite) TestQueryAllEvidence_InvalidPagination() {
func (suite *KeeperTestSuite) TestQuerier_QueryAllEvidence_InvalidPagination() {
ctx := suite.ctx.WithIsCheckTx(false)
cdc, _ := simapp.MakeCodecs()
numEvidence := 100
Expand Down
9 changes: 5 additions & 4 deletions x/evidence/types/querier.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package types

import (
query "github.com/cosmos/cosmos-sdk/types/query"
tmbytes "github.com/tendermint/tendermint/libs/bytes"

query "github.com/cosmos/cosmos-sdk/types/query"
)

// Querier routes for the evidence module
Expand All @@ -16,9 +17,9 @@ func NewQueryEvidenceRequest(hash tmbytes.HexBytes) *QueryEvidenceRequest {
return &QueryEvidenceRequest{EvidenceHash: hash}
}

// NewQueryAllEvidencesRequest creates a new instance of QueryAllEvidencesRequest.
func NewQueryAllEvidencesRequest(req *query.PageRequest) *QueryAllEvidencesRequest {
return &QueryAllEvidencesRequest{Req: req}
// NewQueryAllEvidenceRequest creates a new instance of QueryAllEvidenceRequest.
func NewQueryAllEvidenceRequest(req *query.PageRequest) *QueryAllEvidenceRequest {
return &QueryAllEvidenceRequest{Req: req}
}

// QueryEvidenceParams defines the parameters necessary for querying Evidence.
Expand Down
Loading

0 comments on commit d16bd1f

Please sign in to comment.