Skip to content

Commit

Permalink
feat: added query time for spendable balance
Browse files Browse the repository at this point in the history
  • Loading branch information
mojtaba-esk committed Jul 25, 2023
1 parent dfc04d1 commit 1a1ad2f
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 69 deletions.
4 changes: 3 additions & 1 deletion proto/cosmos/bank/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ message QuerySpendableBalancesResponse {
repeated cosmos.base.v1beta1.Coin balances = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];

int64 query_time = 2;

Check failure on line 133 in proto/cosmos/bank/v1beta1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Field "2" with name "query_time" on message "QuerySpendableBalancesResponse" changed option "json_name" from "pagination" to "queryTime".

Check failure on line 133 in proto/cosmos/bank/v1beta1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Field "2" on message "QuerySpendableBalancesResponse" changed type from "message" to "int64".

Check failure on line 133 in proto/cosmos/bank/v1beta1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Field "2" on message "QuerySpendableBalancesResponse" changed name from "pagination" to "query_time".

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
cosmos.base.query.v1beta1.PageResponse pagination = 3;
}

// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
Expand Down
2 changes: 1 addition & 1 deletion x/bank/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (k BaseKeeper) SpendableBalances(ctx context.Context, req *types.QuerySpend
result = append(result, sdk.NewCoin(c.Denom, spendable.AmountOf(c.Denom)))
}

return &types.QuerySpendableBalancesResponse{Balances: result, Pagination: pageRes}, nil
return &types.QuerySpendableBalancesResponse{Balances: result, QueryTime: sdkCtx.BlockTime().Unix(), Pagination: pageRes}, nil
}

// TotalSupply implements the Query/TotalSupply gRPC method
Expand Down
171 changes: 104 additions & 67 deletions x/bank/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a1ad2f

Please sign in to comment.