Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
forcodedancing committed Aug 1, 2023
1 parent 9a9e22f commit 681b7fd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions e2e/tests/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ func (s *StorageTestSuite) TestLeaveGroup() {
s.Require().Equal(headGroupNftResponse.MetaData.GroupName, groupName)

// 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
12 changes: 6 additions & 6 deletions x/payment/client/cli/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (s *CLITestSuite) TestQueryCmd() {
},
commonFlags...,
),
false, "", &types.QueryGetPaymentAccountsByOwnerResponse{},
false, "", &types.QueryPaymentAccountsByOwnerResponse{},
},
{
"query list-auto-settle-record",
Expand All @@ -64,7 +64,7 @@ func (s *CLITestSuite) TestQueryCmd() {
},
commonFlags...,
),
false, "", &types.QueryAllAutoSettleRecordResponse{},
false, "", &types.QueryAutoSettleRecordsResponse{},
},
{
"query list-payment-account",
Expand All @@ -74,7 +74,7 @@ func (s *CLITestSuite) TestQueryCmd() {
},
commonFlags...,
),
false, "", &types.QueryAllPaymentAccountResponse{},
false, "", &types.QueryPaymentAccountsResponse{},
},
{
"query list-payment-account-count",
Expand All @@ -84,7 +84,7 @@ func (s *CLITestSuite) TestQueryCmd() {
},
commonFlags...,
),
false, "", &types.QueryAllPaymentAccountCountResponse{},
false, "", &types.QueryPaymentAccountCountsResponse{},
},
{
"query list-stream-record",
Expand All @@ -94,7 +94,7 @@ func (s *CLITestSuite) TestQueryCmd() {
},
commonFlags...,
),
false, "", &types.QueryAllStreamRecordResponse{},
false, "", &types.QueryStreamRecordsResponse{},
},
{
"query show-payment-account",
Expand All @@ -116,7 +116,7 @@ func (s *CLITestSuite) TestQueryCmd() {
},
commonFlags...,
),
false, "", &types.QueryGetPaymentAccountCountResponse{},
false, "", &types.QueryPaymentAccountCountResponse{},
},
{
"query show-stream-record",
Expand Down
8 changes: 4 additions & 4 deletions x/storage/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func GetQueryCmd() *cobra.Command {
CmdListObjects(),
CmdVerifyPermission(),
CmdHeadGroup(),
CmdListGroup(),
CmdListGroups(),
CmdHeadGroupMember())

// this line is used by starport scaffolding # 1
Expand Down Expand Up @@ -249,10 +249,10 @@ func CmdHeadGroup() *cobra.Command {
return cmd
}

func CmdListGroup() *cobra.Command {
func CmdListGroups() *cobra.Command {
cmd := &cobra.Command{
Use: "list-group [group-owner]",
Short: "Query list group of owner",
Use: "list-groups [group-owner]",
Short: "Query list groups of owner",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
reqGroupOwner := args[0]
Expand Down
6 changes: 3 additions & 3 deletions x/storage/client/cli/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ func (s *CLITestSuite) TestQueryCmd() {
false, "", &types.QueryListBucketsResponse{},
},
{
"query list-group",
"query list-groups",
append(
[]string{
"list-group",
"list-groups",
sample.RandAccAddressHex(),
},
commonFlags...,
),
false, "", &types.QueryListGroupResponse{},
false, "", &types.QueryListGroupsResponse{},
},
{
"query list-objects",
Expand Down
8 changes: 4 additions & 4 deletions x/storage/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,17 +337,17 @@ func TestHeadGroup(t *testing.T) {
func TestListGroup(t *testing.T) {
// invalid argument
k, ctx := makeKeeper(t)
_, err := k.ListGroup(ctx, nil)
_, err := k.ListGroups(ctx, nil)
require.ErrorContains(t, err, "invalid request")

_, err = k.ListGroup(ctx, &types.QueryListGroupRequest{
_, err = k.ListGroups(ctx, &types.QueryListGroupsRequest{
Pagination: &query.PageRequest{
Limit: types.MaxPaginationLimit + 1,
},
})
require.ErrorContains(t, err, "exceed pagination limit")

_, err = k.ListGroup(ctx, &types.QueryListGroupRequest{
_, err = k.ListGroups(ctx, &types.QueryListGroupsRequest{
GroupOwner: "xxx",
})
require.ErrorContains(t, err, "invalid address hex length")
Expand All @@ -356,7 +356,7 @@ func TestListGroup(t *testing.T) {
func TestHeadGroupMember(t *testing.T) {
// invalid argument
k, ctx := makeKeeper(t)
_, err := k.ListGroup(ctx, nil)
_, err := k.ListGroups(ctx, nil)
require.ErrorContains(t, err, "invalid request")

_, err = k.HeadGroupMember(ctx, &types.QueryHeadGroupMemberRequest{
Expand Down

0 comments on commit 681b7fd

Please sign in to comment.