Skip to content

Commit

Permalink
feat(x/ecocredit): query all credit holders
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler authored and tyler committed Aug 25, 2022
1 parent 8232b9b commit 1339dbe
Show file tree
Hide file tree
Showing 12 changed files with 2,585 additions and 593 deletions.
2,023 changes: 1,589 additions & 434 deletions api/regen/ecocredit/v1/query.pulsar.go

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions api/regen/ecocredit/v1/query_grpc.pb.go

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

8 changes: 6 additions & 2 deletions api/regen/ecocredit/v1/tx.pulsar.go

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

16 changes: 12 additions & 4 deletions api/regen/ecocredit/v1/tx_grpc.pb.go

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

3 changes: 1 addition & 2 deletions proto/regen/ecocredit/basket/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ service Query {
rpc BasketFees(QueryBasketFeesRequest) returns (QueryBasketFeesResponse) {
option (google.api.http).get = "/regen/ecocredit/basket/v1/basket-fees";
}

}

// QueryBasketRequest is the Query/Basket request type.
Expand Down Expand Up @@ -201,7 +200,7 @@ message BasketBalanceInfo {

// QueryBasketFeesRequest is the Query/BasketFees request type.
// Since Revision 1
message QueryBasketFeesRequest { }
message QueryBasketFeesRequest {}

// QueryBasketFeesResponse is the Query/BasketFees response type.
// Since Revision 1
Expand Down
32 changes: 32 additions & 0 deletions proto/regen/ecocredit/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,20 @@ service Query {
}

// Balances queries all credit balances the given account holds.
//
// Since Revision 1
rpc Balances(QueryBalancesRequest) returns (QueryBalancesResponse) {
option (google.api.http).get = "/regen/ecocredit/v1/balances/{address}";
}

// AllBalances queries all credit balances.
rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) {
option (google.api.http) = {
get : "/regen/ecocredit/v1/all-balances"
additional_bindings : [ {get : "/regen/ecocredit/v1/balances"} ]
};
}

// Supply queries the tradable and retired supply of a credit batch.
rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -491,6 +501,28 @@ message QueryBalancesResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryAllBalancesRequest is the Query/AllBalances request type.
//
// Since Revision 1
message QueryAllBalancesRequest {

// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

// QueryAllBalancesResponse is the Query/AllBalances response type.
//
// Since Revision 1
message QueryAllBalancesResponse {

// balances are a list of balances from different credit batches that the
// account holds.
repeated BatchBalanceInfo balances = 1;

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

// QuerySupplyRequest is the Query/Supply request type.
message QuerySupplyRequest {

Expand Down
19 changes: 13 additions & 6 deletions proto/regen/ecocredit/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ service Msg {
// AddClassCreator is a governance method that allows the addition of new
// address to the class creation allowlist.
// Since Revision 1
rpc AddClassCreator(MsgAddClassCreator)
returns (MsgAddClassCreatorResponse);
rpc AddClassCreator(MsgAddClassCreator) returns (MsgAddClassCreatorResponse);

// RemoveClassCreator is a governance method that removes
// address from the creation allowlist.
Expand All @@ -134,12 +133,16 @@ service Msg {
// ToggleCreditClassAllowlist is a governance method that toggles the network
// allowlist to on or off. when on, the class creator allowlist is used to
// enforce which addresses may create classes. when off, any address may
// create classes. Since Revision 1
// create classes.
//
// Since Revision 1
rpc ToggleCreditClassAllowlist(MsgToggleCreditClassAllowlist)
returns (MsgToggleCreditClassAllowlistResponse);

// UpdateClassFees is a governance method that allows for the addition and
// removal of fees to be used for the class creation fee. Since Revision 1
// removal of fees to be used for the class creation fee.
//
// Since Revision 1
rpc UpdateClassFees(MsgUpdateClassFees) returns (MsgUpdateClassFeesResponse);
}

Expand Down Expand Up @@ -634,7 +637,9 @@ message MsgRemoveClassCreator {
message MsgRemoveClassCreatorResponse {}

// MsgToggleCreditClassAllowlist is the Msg/ToggleCreditClassAllowlist request
// type. Since Revision 1
// type. Since
//
// Revision 1
message MsgToggleCreditClassAllowlist {
option (cosmos.msg.v1.signer) = "authority";

Expand All @@ -646,7 +651,9 @@ message MsgToggleCreditClassAllowlist {
}

// MsgToggleCreditClassAllowlistResponse is the Msg/ToggleCreditClassAllowlist
// response type. Since Revision 1
// response type.
//
// Since Revision 1
message MsgToggleCreditClassAllowlistResponse {}

// MsgUpdateClassFees is the Msg/UpdateClassFees request type.
Expand Down
Loading

0 comments on commit 1339dbe

Please sign in to comment.