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: refactor queries of x/collection and x/token #957

Merged
merged 11 commits into from
Apr 13, 2023
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/collection) [\#953](https://github.com/line/lbm-sdk/pull/953) Allow zero amount of coin in x/collection Query/Balance
* (x/collection) [\#954](https://github.com/line/lbm-sdk/pull/954) Remove duplicated events in x/collection Msg/Modify
* (x/collection) [\#955](https://github.com/line/lbm-sdk/pull/955) Return nil where the parent not exists in x/collection Query/Parent
* (x/collection) [\#957](https://github.com/line/lbm-sdk/pull/957) Do not check existence of collection in Query/Balance

### Removed

Expand Down
4 changes: 0 additions & 4 deletions x/collection/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ func (s queryServer) Balance(c context.Context, req *collection.QueryBalanceRequ
return nil, err
}

if err := s.validateExistenceOfCollectionGRPC(ctx, req.ContractId); err != nil {
return nil, err
}

balance := s.keeper.GetBalance(ctx, req.ContractId, addr, req.TokenId)
coin := collection.Coin{
TokenId: req.TokenId,
Expand Down
5 changes: 0 additions & 5 deletions x/collection/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ func (s *KeeperTestSuite) TestQueryBalance() {
address: sdk.AccAddress("notfound"),
tokenID: tokenID,
},
"collection not found": {
contractID: "deadbeef",
address: s.vendor,
tokenID: tokenID,
},
}

for name, tc := range testCases {
Expand Down