Skip to content

Commit

Permalink
feat: add flag to enable/disable heavy queries and refactor apis
Browse files Browse the repository at this point in the history
  • Loading branch information
forcodedancing committed Jul 28, 2023
1 parent 186de54 commit 8314e66
Show file tree
Hide file tree
Showing 29 changed files with 2,128 additions and 2,433 deletions.
1 change: 1 addition & 0 deletions cmd/gnfd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ func (a appCreator) newApp(
baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))),
baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))),
baseapp.SetChainID(chainID),
baseapp.SetEnableUnsafeQuery(cast.ToBool(appOpts.Get(server.FlagEnableUnsafeQuery))),
)
}

Expand Down
57 changes: 40 additions & 17 deletions e2e/tests/payment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"testing"
"time"

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

sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
Expand Down Expand Up @@ -56,6 +58,27 @@ func (s *PaymentTestSuite) SetupTest() {
s.RefreshGVGFamilies()
}

func (s *PaymentTestSuite) TestQueryPaymentAccounts() {
_, err := s.Client.PaymentAccounts(context.Background(), &paymenttypes.QueryPaymentAccountsRequest{
Pagination: &query.PageRequest{
Offset: 10, // offset is not allowed
},
})
s.Require().Error(err)

_, err = s.Client.PaymentAccounts(context.Background(), &paymenttypes.QueryPaymentAccountsRequest{
Pagination: &query.PageRequest{
CountTotal: true, // count total = true is not allowed
},
})
s.Require().Error(err)

_, err = s.Client.PaymentAccounts(context.Background(), &paymenttypes.QueryPaymentAccountsRequest{
Pagination: &query.PageRequest{},
})
s.Require().NoError(err)
}

func (s *PaymentTestSuite) TestCreatePaymentAccount() {
user := s.GenAndChargeAccounts(1, 100)[0]
ctx := context.Background()
Expand All @@ -65,10 +88,10 @@ func (s *PaymentTestSuite) TestCreatePaymentAccount() {
}
_ = s.SendTxBlock(user, msgCreatePaymentAccount)
// query user's payment accounts
queryGetPaymentAccountsByOwnerRequest := paymenttypes.QueryGetPaymentAccountsByOwnerRequest{
queryGetPaymentAccountsByOwnerRequest := paymenttypes.QueryPaymentAccountsByOwnerRequest{
Owner: user.GetAddr().String(),
}
paymentAccounts, err := s.Client.GetPaymentAccountsByOwner(ctx, &queryGetPaymentAccountsByOwnerRequest)
paymentAccounts, err := s.Client.PaymentAccountsByOwner(ctx, &queryGetPaymentAccountsByOwnerRequest)
s.Require().NoError(err)
s.T().Log(paymentAccounts)
s.Require().Equal(1, len(paymentAccounts.PaymentAccounts))
Expand Down Expand Up @@ -300,8 +323,8 @@ func (s *PaymentTestSuite) TestDeposit_ActiveAccount() {
Creator: userAddr,
}
_ = s.SendTxBlock(user, msgCreatePaymentAccount)
paymentAccountsReq := &paymenttypes.QueryGetPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.GetPaymentAccountsByOwner(ctx, paymentAccountsReq)
paymentAccountsReq := &paymenttypes.QueryPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.PaymentAccountsByOwner(ctx, paymentAccountsReq)
s.Require().NoError(err)
s.T().Logf("paymentAccounts %s", core.YamlString(paymentAccounts))
paymentAddr := paymentAccounts.PaymentAccounts[0]
Expand Down Expand Up @@ -385,8 +408,8 @@ func (s *PaymentTestSuite) TestDeposit_ResumeInOneBlock() {
Creator: userAddr,
}
_ = s.SendTxBlock(user, msgCreatePaymentAccount)
paymentAccountsReq := &paymenttypes.QueryGetPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.GetPaymentAccountsByOwner(ctx, paymentAccountsReq)
paymentAccountsReq := &paymenttypes.QueryPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.PaymentAccountsByOwner(ctx, paymentAccountsReq)
s.Require().NoError(err)
s.T().Logf("paymentAccounts %s", core.YamlString(paymentAccounts))
paymentAddr := paymentAccounts.PaymentAccounts[0]
Expand Down Expand Up @@ -502,8 +525,8 @@ func (s *PaymentTestSuite) TestDeposit_ResumeInBlocks() {
Creator: userAddr,
}
_ = s.SendTxBlock(user, msgCreatePaymentAccount)
paymentAccountsReq := &paymenttypes.QueryGetPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.GetPaymentAccountsByOwner(ctx, paymentAccountsReq)
paymentAccountsReq := &paymenttypes.QueryPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.PaymentAccountsByOwner(ctx, paymentAccountsReq)
s.Require().NoError(err)
s.T().Logf("paymentAccounts %s", core.YamlString(paymentAccounts))
paymentAddr := paymentAccounts.PaymentAccounts[0]
Expand Down Expand Up @@ -637,8 +660,8 @@ func (s *PaymentTestSuite) TestAutoSettle_InOneBlock() {
Creator: userAddr,
}
_ = s.SendTxBlock(user, msgCreatePaymentAccount)
paymentAccountsReq := &paymenttypes.QueryGetPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.GetPaymentAccountsByOwner(ctx, paymentAccountsReq)
paymentAccountsReq := &paymenttypes.QueryPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.PaymentAccountsByOwner(ctx, paymentAccountsReq)
s.Require().NoError(err)
s.T().Logf("paymentAccounts %s", core.YamlString(paymentAccounts))
paymentAddr := paymentAccounts.PaymentAccounts[0]
Expand Down Expand Up @@ -776,8 +799,8 @@ func (s *PaymentTestSuite) TestAutoSettle_InBlocks() {
Creator: userAddr,
}
_ = s.SendTxBlock(user, msgCreatePaymentAccount)
paymentAccountsReq := &paymenttypes.QueryGetPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.GetPaymentAccountsByOwner(ctx, paymentAccountsReq)
paymentAccountsReq := &paymenttypes.QueryPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.PaymentAccountsByOwner(ctx, paymentAccountsReq)
s.Require().NoError(err)
s.T().Logf("paymentAccounts %s", core.YamlString(paymentAccounts))
paymentAddr := paymentAccounts.PaymentAccounts[0]
Expand Down Expand Up @@ -873,8 +896,8 @@ func (s *PaymentTestSuite) TestWithdraw() {
Creator: userAddr,
}
_ = s.SendTxBlock(user, msgCreatePaymentAccount)
paymentAccountsReq := &paymenttypes.QueryGetPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.GetPaymentAccountsByOwner(ctx, paymentAccountsReq)
paymentAccountsReq := &paymenttypes.QueryPaymentAccountsByOwnerRequest{Owner: userAddr}
paymentAccounts, err := s.Client.PaymentQueryClient.PaymentAccountsByOwner(ctx, paymentAccountsReq)
s.Require().NoError(err)
s.T().Logf("paymentAccounts %s", core.YamlString(paymentAccounts))
paymentAddr := paymentAccounts.PaymentAccounts[0]
Expand Down Expand Up @@ -1170,11 +1193,11 @@ func (s *PaymentTestSuite) TestStorageBill_Smoke() {
s.checkStreamRecordsBeforeAndAfter(streamRecordsBeforeCreateEmptyObject, streamRecordsAfterCreateEmptyObject, readPrice, readChargeRate, primaryStorePrice, secondaryStorePrice, chargeSize, uint64(emptyPayloadSize))

// test query auto settle records
queryAllAutoSettleRecordRequest := paymenttypes.QueryAllAutoSettleRecordRequest{}
queryAllAutoSettleRecordResponse, err := s.Client.AutoSettleRecordAll(ctx, &queryAllAutoSettleRecordRequest)
queryAllAutoSettleRecordRequest := paymenttypes.QueryAutoSettleRecordsRequest{}
queryAllAutoSettleRecordResponse, err := s.Client.AutoSettleRecords(ctx, &queryAllAutoSettleRecordRequest)
s.Require().NoError(err)
s.T().Logf("queryAllAutoSettleRecordResponse %s", core.YamlString(queryAllAutoSettleRecordResponse))
s.Require().True(len(queryAllAutoSettleRecordResponse.AutoSettleRecord) >= 1)
s.Require().True(len(queryAllAutoSettleRecordResponse.AutoSettleRecords) >= 1)

// simulate delete object, check fee preview
deleteObjectMsg := storagetypes.NewMsgDeleteObject(user.GetAddr(), bucketName, objectName)
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,8 @@ func (s *StorageTestSuite) TestGroupMembersAndPolicyGC() {
s.Require().Equal(headGroupMemberResponse.GroupMember.GroupId, headGroupResponse.GetGroupInfo().Id)

// list group
queryListGroupReq := storagetypes.QueryListGroupRequest{GroupOwner: owner.GetAddr().String()}
queryListGroupResp, err := s.Client.ListGroup(ctx, &queryListGroupReq)
queryListGroupReq := storagetypes.QueryListGroupsRequest{GroupOwner: owner.GetAddr().String()}
queryListGroupResp, err := s.Client.ListGroups(ctx, &queryListGroupReq)
s.Require().NoError(err)
s.T().Log(queryListGroupResp.String())

Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/storage_bill_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,10 @@ func (s *PaymentTestSuite) CreatePaymentAccount(user keys.KeyManager, amount, de
}
_ = s.SendTxBlock(user, msgCreatePaymentAccount)
// query user's payment accounts
queryGetPaymentAccountsByOwnerRequest := paymenttypes.QueryGetPaymentAccountsByOwnerRequest{
queryGetPaymentAccountsByOwnerRequest := paymenttypes.QueryPaymentAccountsByOwnerRequest{
Owner: user.GetAddr().String(),
}
paymentAccounts, err := s.Client.GetPaymentAccountsByOwner(ctx, &queryGetPaymentAccountsByOwnerRequest)
paymentAccounts, err := s.Client.PaymentAccountsByOwner(ctx, &queryGetPaymentAccountsByOwnerRequest)
s.Require().NoError(err)
s.T().Log(paymentAccounts)
paymentAccountAddr := paymentAccounts.PaymentAccounts[len(paymentAccounts.PaymentAccounts)-1]
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ func (s *StorageTestSuite) TestCreateGroup() {
s.Require().Equal(queryHeadGroupResp.GroupInfo.Owner, owner.GetAddr().String())

// 3. ListGroup
queryListGroupReq := storagetypes.QueryListGroupRequest{GroupOwner: owner.GetAddr().String()}
queryListGroupResp, err := s.Client.ListGroup(ctx, &queryListGroupReq)
queryListGroupReq := storagetypes.QueryListGroupsRequest{GroupOwner: owner.GetAddr().String()}
queryListGroupResp, err := s.Client.ListGroups(ctx, &queryListGroupReq)
s.Require().NoError(err)
s.Require().GreaterOrEqual(len(queryListGroupResp.GroupInfos), 1)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ replace (
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.2-alpha.2
github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.5
github.com/cosmos/cosmos-sdk => github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230728104115-00ab22f7d54b
github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1-alpha.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ github.com/bnb-chain/greenfield-cometbft v0.0.2-alpha.2 h1:ys9kmgtRx04wcCextE6Cr
github.com/bnb-chain/greenfield-cometbft v0.0.2-alpha.2/go.mod h1:EBmwmUdaNbGPyGjf1cMuoN3pAeM2tQu7Lfg95813EAw=
github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU=
github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI=
github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.5 h1:VZKjhnM/GvdG6iTXj63SrBgDQLtXG4piDDG2fTMTiV4=
github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.5/go.mod h1:EghjYxFg4NRNMfTJ6g9rVhjImhXQm+tuboknHqeGmJA=
github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9 h1:6fLpmmI0EZvDTfPvI0zy5dBaaTUboHnEkoC5/p/w8TQ=
github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9/go.mod h1:rbc4o84RSEvhf09o2+4Qiazsv0snRJLiEZdk17HeIDw=
github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9 h1:1ZdK+iR1Up02bOa2YTZCml7PBpP//kcdamOcK6aWO/s=
Expand Down Expand Up @@ -360,6 +358,8 @@ github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230728104115-00ab22f7d54b h1:fIRftTPUOjRxh13rwwb5Y54rxV1aHj6QVp473nU3YHg=
github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230728104115-00ab22f7d54b/go.mod h1:EghjYxFg4NRNMfTJ6g9rVhjImhXQm+tuboknHqeGmJA=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
Expand Down
76 changes: 38 additions & 38 deletions proto/greenfield/payment/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,59 +24,59 @@ service Query {
option (google.api.http).get = "/greenfield/payment/params";
}

// ParamsByTimestamp queries the parameters of the module.
// ParamsByTimestamp queries the parameter of the module by timestamp.
rpc ParamsByTimestamp(QueryParamsByTimestampRequest) returns (QueryParamsByTimestampResponse) {
option (google.api.http).get = "/greenfield/payment/params/{timestamp}";
}

// Queries a StreamRecord by index.
// Queries our flows by account.
rpc OutFlows(QueryOutFlowsRequest) returns (QueryOutFlowsResponse) {
option (google.api.http).get = "/greenfield/payment/out_flows/{account}";
}

// Queries a StreamRecord by index.
// Queries a stream record by account.
rpc StreamRecord(QueryGetStreamRecordRequest) returns (QueryGetStreamRecordResponse) {
option (google.api.http).get = "/greenfield/payment/stream_record/{account}";
}

// Queries a list of StreamRecord items.
rpc StreamRecordAll(QueryAllStreamRecordRequest) returns (QueryAllStreamRecordResponse) {
option (google.api.http).get = "/greenfield/payment/stream_record";
// Queries all stream records.
rpc StreamRecords(QueryStreamRecordsRequest) returns (QueryStreamRecordsResponse) {
option (google.api.http).get = "/greenfield/payment/stream_records";
}

// Queries a PaymentAccountCount by index.
rpc PaymentAccountCount(QueryGetPaymentAccountCountRequest) returns (QueryGetPaymentAccountCountResponse) {
// Queries the count of payment account by owner.
rpc PaymentAccountCount(QueryPaymentAccountCountRequest) returns (QueryPaymentAccountCountResponse) {
option (google.api.http).get = "/greenfield/payment/payment_account_count/{owner}";
}

// Queries a list of PaymentAccountCount items.
rpc PaymentAccountCountAll(QueryAllPaymentAccountCountRequest) returns (QueryAllPaymentAccountCountResponse) {
option (google.api.http).get = "/greenfield/payment/payment_account_count";
// Queries all counts of payment account for all owners.
rpc PaymentAccountCounts(QueryPaymentAccountCountsRequest) returns (QueryPaymentAccountCountsResponse) {
option (google.api.http).get = "/greenfield/payment/payment_account_counts";
}

// Queries a PaymentAccount by index.
// Queries a payment account by payment account address.
rpc PaymentAccount(QueryGetPaymentAccountRequest) returns (QueryGetPaymentAccountResponse) {
option (google.api.http).get = "/greenfield/payment/payment_account/{addr}";
}

// Queries a list of PaymentAccount items.
rpc PaymentAccountAll(QueryAllPaymentAccountRequest) returns (QueryAllPaymentAccountResponse) {
option (google.api.http).get = "/greenfield/payment/payment_account";
// Queries all payment accounts.
rpc PaymentAccounts(QueryPaymentAccountsRequest) returns (QueryPaymentAccountsResponse) {
option (google.api.http).get = "/greenfield/payment/payment_accounts";
}

// Queries a list of DynamicBalance items.
// Queries dynamic balance of a payment account.
rpc DynamicBalance(QueryDynamicBalanceRequest) returns (QueryDynamicBalanceResponse) {
option (google.api.http).get = "/greenfield/payment/dynamic_balance/{account}";
}

// Queries a list of GetPaymentAccountsByOwner items.
rpc GetPaymentAccountsByOwner(QueryGetPaymentAccountsByOwnerRequest) returns (QueryGetPaymentAccountsByOwnerResponse) {
option (google.api.http).get = "/greenfield/payment/get_payment_accounts_by_owner/{owner}";
// Queries all payment accounts by a owner.
rpc PaymentAccountsByOwner(QueryPaymentAccountsByOwnerRequest) returns (QueryPaymentAccountsByOwnerResponse) {
option (google.api.http).get = "/greenfield/payment/payment_accounts_by_owner/{owner}";
}

// Queries a list of AutoSettleRecord items.
rpc AutoSettleRecordAll(QueryAllAutoSettleRecordRequest) returns (QueryAllAutoSettleRecordResponse) {
option (google.api.http).get = "/greenfield/payment/auto_settle_record";
// Queries all auto settle records.
rpc AutoSettleRecords(QueryAutoSettleRecordsRequest) returns (QueryAutoSettleRecordsResponse) {
option (google.api.http).get = "/greenfield/payment/auto_settle_records";
}
}

Expand Down Expand Up @@ -117,29 +117,29 @@ message QueryGetStreamRecordResponse {
StreamRecord stream_record = 1 [(gogoproto.nullable) = false];
}

message QueryAllStreamRecordRequest {
message QueryStreamRecordsRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllStreamRecordResponse {
repeated StreamRecord stream_record = 1 [(gogoproto.nullable) = false];
message QueryStreamRecordsResponse {
repeated StreamRecord stream_records = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetPaymentAccountCountRequest {
message QueryPaymentAccountCountRequest {
string owner = 1;
}

message QueryGetPaymentAccountCountResponse {
message QueryPaymentAccountCountResponse {
PaymentAccountCount payment_account_count = 1 [(gogoproto.nullable) = false];
}

message QueryAllPaymentAccountCountRequest {
message QueryPaymentAccountCountsRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllPaymentAccountCountResponse {
repeated PaymentAccountCount payment_account_count = 1 [(gogoproto.nullable) = false];
message QueryPaymentAccountCountsResponse {
repeated PaymentAccountCount payment_account_counts = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

Expand All @@ -151,12 +151,12 @@ message QueryGetPaymentAccountResponse {
PaymentAccount payment_account = 1 [(gogoproto.nullable) = false];
}

message QueryAllPaymentAccountRequest {
message QueryPaymentAccountsRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllPaymentAccountResponse {
repeated PaymentAccount payment_account = 1 [(gogoproto.nullable) = false];
message QueryPaymentAccountsResponse {
repeated PaymentAccount payment_accounts = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

Expand Down Expand Up @@ -201,19 +201,19 @@ message QueryDynamicBalanceResponse {
];
}

message QueryGetPaymentAccountsByOwnerRequest {
message QueryPaymentAccountsByOwnerRequest {
string owner = 1;
}

message QueryGetPaymentAccountsByOwnerResponse {
message QueryPaymentAccountsByOwnerResponse {
repeated string paymentAccounts = 1;
}

message QueryAllAutoSettleRecordRequest {
message QueryAutoSettleRecordsRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllAutoSettleRecordResponse {
repeated AutoSettleRecord auto_settle_record = 1 [(gogoproto.nullable) = false];
message QueryAutoSettleRecordsResponse {
repeated AutoSettleRecord auto_settle_records = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
8 changes: 4 additions & 4 deletions proto/greenfield/storage/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ service Query {
}

// Queries a list of ListGroup items.
rpc ListGroup(QueryListGroupRequest) returns (QueryListGroupResponse) {
option (google.api.http).get = "/greenfield/storage/list_group/{group_owner}";
rpc ListGroups(QueryListGroupsRequest) returns (QueryListGroupsResponse) {
option (google.api.http).get = "/greenfield/storage/list_groups/{group_owner}";
}

// Queries a list of HeadGroupMember items.
Expand Down Expand Up @@ -247,12 +247,12 @@ message QueryHeadGroupResponse {
GroupInfo group_info = 1;
}

message QueryListGroupRequest {
message QueryListGroupsRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
string group_owner = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

message QueryListGroupResponse {
message QueryListGroupsResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 1;
repeated GroupInfo group_infos = 2;
}
Expand Down
Loading

0 comments on commit 8314e66

Please sign in to comment.