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

x/bank: Refactor CLI & Tests #6525

Merged
merged 27 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
24edb2a
init
alexanderbez Jun 26, 2020
876bcaa
remove old tests
alexanderbez Jun 26, 2020
98b9226
bank/cli: TestGetBalancesCmd
alexanderbez Jun 26, 2020
26eb2e4
default to 1 val
alexanderbez Jun 26, 2020
963e413
add query tests
alexanderbez Jun 26, 2020
a0e5ecd
cli: remove indent and use ReadGetCommandFlags
alexanderbez Jun 27, 2020
6c1f9b4
Merge branch 'master' into bez/6423-x-bank-cli-refactor
alexanderbez Jun 29, 2020
2f9ae75
Updates
alexanderbez Jun 29, 2020
ec870e0
test updates
alexanderbez Jun 29, 2020
8b7a624
Updates
alexanderbez Jun 29, 2020
cfeaf94
Add back missing line
alexanderbez Jun 29, 2020
079019d
more test cases
alexanderbez Jun 29, 2020
e76f949
Merge branch 'master' into bez/6423-x-bank-cli-refactor
alexanderbez Jun 29, 2020
aa4f188
Merge branch 'master' into bez/6423-x-bank-cli-refactor
alexanderbez Jun 30, 2020
ba98321
tests: attempt fix
alexanderbez Jun 30, 2020
dcc5fa7
lint++
alexanderbez Jun 30, 2020
c25fed3
tests: attempt fix
alexanderbez Jun 30, 2020
512b6bc
Merge branch 'master' into bez/6423-x-bank-cli-refactor
alexanderbez Jun 30, 2020
a73f357
cl++
alexanderbez Jun 30, 2020
7dbac20
cl++
alexanderbez Jun 30, 2020
d261237
tests: attempt fix
alexanderbez Jun 30, 2020
8c81821
tests: attempt fix
alexanderbez Jun 30, 2020
be638d3
undo changes
alexanderbez Jun 30, 2020
532b6c4
Merge branch 'master' into bez/6423-x-bank-cli-refactor
alexanderbez Jun 30, 2020
66cb961
fix test
alexanderbez Jun 30, 2020
40b6ec7
Merge branch 'bez/6423-x-bank-cli-refactor' of github.com:cosmos/cosm…
alexanderbez Jun 30, 2020
6ea2632
Merge branch 'master' into bez/6423-x-bank-cli-refactor
alexanderbez Jun 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions proto/cosmos/bank/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,69 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";

// Query provides defines the gRPC querier service
service Query {
// Balance queries the balance of a single coin for a single account
rpc Balance (QueryBalanceRequest) returns (QueryBalanceResponse) { }
// Balance queries the balance of a single coin for a single account
rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) {}

// AllBalances queries the balance of all coins for a single account
rpc AllBalances (QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { }
// AllBalances queries the balance of all coins for a single account
rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) {}

// TotalSupply queries the total supply of all coins
rpc TotalSupply (QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { }
// TotalSupply queries the total supply of all coins
rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) {}

// SupplyOf queries the supply of a single coin
rpc SupplyOf (QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { }
// SupplyOf queries the supply of a single coin
rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) {}
}

// QueryBalanceRequest is the request type for the Query/Balance RPC method
message QueryBalanceRequest {
// address is the address to query balances for
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// address is the address to query balances for
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];

// denom is the coin denom to query balances for
string denom = 2;
// denom is the coin denom to query balances for
string denom = 2;
}

// QueryBalanceResponse is the response type for the Query/Balance RPC method
message QueryBalanceResponse {

// balance is the balance of the coin
cosmos.Coin balance = 1;
// balance is the balance of the coin
cosmos.Coin balance = 1;
}

// QueryBalanceRequest is the request type for the Query/AllBalances RPC method
message QueryAllBalancesRequest {
// address is the address to query balances for
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// address is the address to query balances for
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest req = 2;
}

// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC method
message QueryAllBalancesResponse {
// balances is the balances of the coins
repeated cosmos.Coin balances = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
// balances is the balances of the coins
repeated cosmos.Coin balances = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse res = 2;
}

// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method
message QueryTotalSupplyRequest {}

// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC method
message QueryTotalSupplyResponse {
// supply is the supply of the coins
repeated cosmos.Coin supply = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
// supply is the supply of the coins
repeated cosmos.Coin supply = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}

// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method
message QuerySupplyOfRequest {
string denom = 1;
string denom = 1;
}

// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method
message QuerySupplyOfResponse {
// amount is the supply of the coin
string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
// amount is the supply of the coin
cosmos.Coin amount = 1
[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.nullable) = false];
Copy link
Contributor Author

@alexanderbez alexanderbez Jun 26, 2020

Choose a reason for hiding this comment

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

This returns an sdk.Coin, which matches the querier behavior and other queries similar to this.

}
223 changes: 0 additions & 223 deletions x/bank/client/cli/cli_test.go

This file was deleted.

Loading