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

feat(x/ecocredit)!: add ecocredit projects msg & query server implementations #647

Merged
merged 48 commits into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
12afe2b
build: run make proto-gen
aleem1314 Nov 18, 2021
5cb9953
feat: add create project msg
aleem1314 Nov 18, 2021
bce3c08
add project id tests
aleem1314 Nov 18, 2021
dbd6468
feat: fix msg tests
aleem1314 Nov 19, 2021
0e9da04
feat: add msg & query server implementations
aleem1314 Nov 19, 2021
12e125e
chore: register msgs
aleem1314 Nov 19, 2021
8f42f8d
feat: fix cli
aleem1314 Nov 20, 2021
9372b64
fix: fix genesis import & export
aleem1314 Nov 23, 2021
969a439
feat: add create project simulation
aleem1314 Nov 23, 2021
45396c5
fix: fix msg server tests
aleem1314 Nov 23, 2021
dd2d754
Merge branch 'master' into aleem/646-ecocredit-projects
aleem1314 Nov 24, 2021
5f84f4f
chore: go mod tidy
aleem1314 Nov 24, 2021
e62a7be
fix: fix simulations
aleem1314 Nov 24, 2021
38ea9a8
WIP: add cli commands
aleem1314 Nov 24, 2021
f9751ee
feat: add project-info command
aleem1314 Nov 24, 2021
6a057dc
chore: fix cli tx tests
aleem1314 Nov 25, 2021
e4a7ba6
chore: fix error
aleem1314 Nov 25, 2021
2cc82e3
chore: update github action
aleem1314 Nov 25, 2021
a3adedb
wip: fix tests
aleem1314 Nov 25, 2021
6f31d25
chore: add logs to failing tests
aleem1314 Nov 25, 2021
43f40cd
fix: fix failing tests
aleem1314 Nov 25, 2021
8636f7e
Update .github/workflows/test.yml
aleem1314 Nov 25, 2021
cfa2a39
Update .github/workflows/test.yml
aleem1314 Nov 25, 2021
d47d1f0
update workflows/test.yml
aleem1314 Nov 29, 2021
a7bc2da
Merge branch 'master' into aleem/646-ecocredit-projects
aleem1314 Nov 29, 2021
5182da0
Update x/ecocredit/client/query.go
aleem1314 Nov 30, 2021
7394051
Update x/ecocredit/client/query.go
aleem1314 Nov 30, 2021
763faf8
Update x/ecocredit/project.go
aleem1314 Nov 30, 2021
4c4262c
chore: review changes
aleem1314 Nov 30, 2021
be69089
Merge branch 'master' into aleem/646-ecocredit-projects
aleem1314 Dec 3, 2021
e84ce1d
chore: run make proto-gen
aleem1314 Dec 3, 2021
94f5563
chore: go mod tidy
aleem1314 Dec 3, 2021
f9a66b2
fix build error
aleem1314 Dec 3, 2021
f5a42c7
chore: review changes
aleem1314 Dec 6, 2021
5c3875c
feat: add genesis test
aleem1314 Dec 6, 2021
fa08bfe
Update x/ecocredit/server/genesis.go
aleem1314 Dec 7, 2021
ce2488a
chore: review changes
aleem1314 Dec 7, 2021
90a784c
chore: review changes
aleem1314 Dec 10, 2021
610751c
Merge branch 'master' into aleem/646-ecocredit-projects
aleem1314 Dec 10, 2021
a979b32
chore: fix failing tests
aleem1314 Dec 10, 2021
b99e9ef
chore: add project id generator tests
aleem1314 Jan 3, 2022
92311e0
chore: fix test
aleem1314 Jan 3, 2022
24e998d
chore: fix test
aleem1314 Jan 3, 2022
816f1d1
chore: fix test
aleem1314 Jan 3, 2022
4101deb
Update x/ecocredit/client/tx.go
aleem1314 Jan 3, 2022
29fa4e5
Update x/ecocredit/project.go
aleem1314 Jan 3, 2022
231a23a
Update x/ecocredit/server/server_test.go
aleem1314 Jan 3, 2022
a23d2eb
Merge branch 'master' into aleem/646-ecocredit-projects
aleem1314 Jan 3, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
with:
flags: ${{matrix.envs}}
file: coverage.txt

aleem1314 marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ require (
github.com/stretchr/testify v1.7.0
github.com/tendermint/tendermint v0.34.14
github.com/tendermint/tm-db v0.6.4
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20211111162719-482062a4217b // indirect
)

require (
Expand Down Expand Up @@ -123,9 +120,12 @@ require (
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/zondax/hid v0.9.0 // indirect
go.etcd.io/bbolt v1.3.5 // indirect
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f // indirect
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sys v0.0.0-20210903071746-97244b99971b // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect
Expand Down
11 changes: 6 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,8 @@ golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWP
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa h1:idItI2DDfCokpg0N51B2VtiLdJ4vAuXC9fnCb2gACo4=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 h1:/pEO3GD/ABYAjuakUS6xSEmmlyVS4kxBNkeA9tLJiTI=
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -1228,8 +1228,9 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f h1:w6wWR0H+nyVpbSAQbzVEIACVyr/h8l/BEkY6Sokc7Eg=
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1543,8 +1544,8 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20211111162719-482062a4217b h1:qvEQEwKjZRAg6rjY/jqfJ7T8/w/D7jTIFJGcaSka96k=
google.golang.org/genproto v0.0.0-20211111162719-482062a4217b/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 h1:b9mVrqYfq3P4bCdaLg1qtBnPzUYgglsIdjZkL/fQVOE=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
Expand Down
3 changes: 3 additions & 0 deletions proto/regen/ecocredit/v1alpha2/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ message GenesisState {
// project_info is the list of projects.
repeated ProjectInfo project_info = 7;

// project_seq is the project table orm.Sequence,
// it is used to get the next project ID.
uint64 project_seq = 8;
aleem1314 marked this conversation as resolved.
Show resolved Hide resolved
}

// Balance represents tradable or retired units of a credit batch with an
Expand Down
56 changes: 54 additions & 2 deletions x/ecocredit/client/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func QueryCmd(name string) *cobra.Command {
QuerySupplyCmd(),
QueryCreditTypesCmd(),
QueryParams(),
QueryProjectsCmd(),
QueryProjectInfoCmd(),
)
return cmd
}
Expand Down Expand Up @@ -88,11 +90,61 @@ func QueryClassInfoCmd() *cobra.Command {
})
}

// QueryProjectsCmd returns a query command that retrieves projects.
func QueryProjectsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "projects [class_id]",
Short: "List all projects in the given class with pagination flags",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
c, ctx, err := mkQueryClient(cmd)
if err != nil {
return err
}

pagination, err := client.ReadPageRequest(cmd.Flags())
if err != nil {
return err
}

res, err := c.Projects(cmd.Context(), &ecocredit.QueryProjectsRequest{
ClassId: args[0],
Pagination: pagination,
})
return print(ctx, res, err)
},
}
flags.AddPaginationFlagsToCmd(cmd, "projects")
return qflags(cmd)
}

// QueryProjectInfoCmd returns a query command that retrieves project information.
func QueryProjectInfoCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "project-info [project_id]",
Short: "Retrive project info",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
c, ctx, err := mkQueryClient(cmd)
if err != nil {
return err
}

res, err := c.ProjectInfo(cmd.Context(), &ecocredit.QueryProjectInfoRequest{
ProjectId: args[0],
})
return print(ctx, res, err)
},
}

return qflags(cmd)
}

// QueryBatchesCmd returns a query command that retrieves credit batches for a
// given credit class.
aleem1314 marked this conversation as resolved.
Show resolved Hide resolved
func QueryBatchesCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "batches [class_id]",
Use: "batches [project_id]",
Short: "List all credit batches in the given class with pagination flags",
aleem1314 marked this conversation as resolved.
Show resolved Hide resolved
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -107,7 +159,7 @@ func QueryBatchesCmd() *cobra.Command {
}

res, err := c.Batches(cmd.Context(), &ecocredit.QueryBatchesRequest{
ClassId: args[0],
ProjectId: args[0],
Pagination: pagination,
})
return print(ctx, res, err)
Expand Down
58 changes: 29 additions & 29 deletions x/ecocredit/client/testsuite/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ func (s *IntegrationTestSuite) TestGetClasses() {
}{
{
"invalid path",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/class", val.APIAddress),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/class", val.APIAddress),
true,
0,
},
{
"valid query",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/classes", val.APIAddress),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/classes", val.APIAddress),
false,
4,
},
{
"valid query pagination",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/classes?pagination.limit=2", val.APIAddress),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/classes?pagination.limit=2", val.APIAddress),
false,
2,
},
Expand Down Expand Up @@ -69,21 +69,21 @@ func (s *IntegrationTestSuite) TestGetClass() {
}{
{
"invalid path",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/class", val.APIAddress),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/class", val.APIAddress),
true,
"Not Implemented",
"",
},
{
"class not found",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/classes/%s", val.APIAddress, "C999"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/classes/%s", val.APIAddress, "C999"),
true,
"not found",
"",
},
{
"valid class-id",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/classes/%s", val.APIAddress, "C01"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/classes/%s", val.APIAddress, "C01"),
false,
"",
"C01",
Expand Down Expand Up @@ -122,29 +122,29 @@ func (s *IntegrationTestSuite) TestGetBatches() {
errMsg string
}{
{
"invalid class-id",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/classes/%s/batches", val.APIAddress, "abcd"),
"invalid project-id",
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/projects/%s/batches", val.APIAddress, "abc-d"),
0,
true,
"class ID didn't match the format",
"invalid projectID",
},
{
"no batches found",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/classes/%s/batches", val.APIAddress, "C100"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/projects/%s/batches", val.APIAddress, "P02"),
0,
false,
"",
},
{
"valid request",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/classes/%s/batches", val.APIAddress, "C01"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/projects/%s/batches", val.APIAddress, "P01"),
4,
false,
"",
},
{
"valid request with pagination",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/classes/%s/batches?pagination.limit=2", val.APIAddress, "C01"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/projects/%s/batches?pagination.limit=2", val.APIAddress, "P01"),
2,
false,
"",
Expand Down Expand Up @@ -177,32 +177,32 @@ func (s *IntegrationTestSuite) TestGetBatch() {
val := s.network.Validators[0]

testCases := []struct {
name string
url string
expErr bool
errMsg string
classID string
name string
url string
expErr bool
errMsg string
projectID string
}{
{
"invalid batch denom",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/batches/%s", val.APIAddress, "C999"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/batches/%s", val.APIAddress, "C999"),
true,
"invalid denom",
"",
},
{
"no batches found",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/batches/%s", val.APIAddress, "A00-00000000-00000000-000"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/batches/%s", val.APIAddress, "A00-00000000-00000000-000"),
true,
"not found",
"",
},
{
"valid request",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/batches/%s", val.APIAddress, "C01-20210101-20210201-002"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/batches/%s", val.APIAddress, "C01-20210101-20210201-002"),
false,
"",
"C01",
"P01",
},
}

Expand All @@ -222,7 +222,7 @@ func (s *IntegrationTestSuite) TestGetBatch() {
} else {
require.NoError(err)
require.NotNil(batch.Info)
require.Equal(batch.Info.ClassId, tc.classID)
require.Equal(batch.Info.ProjectId, tc.projectID)
}
})
}
Expand All @@ -232,7 +232,7 @@ func (s *IntegrationTestSuite) TestCreditTypes() {
require := s.Require()
val := s.network.Validators[0]

url := fmt.Sprintf("%s/regen/ecocredit/v1alpha1/credit-types", val.APIAddress)
url := fmt.Sprintf("%s/regen/ecocredit/v1alpha2/credit-types", val.APIAddress)
resp, err := rest.GetRequest(url)
require.NoError(err)

Expand All @@ -256,19 +256,19 @@ func (s *IntegrationTestSuite) TestGetBalance() {
}{
{
"invalid batch-denom",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/batches/%s/balance/%s", val.APIAddress, "abcd", val.Address.String()),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/batches/%s/balance/%s", val.APIAddress, "abcd", val.Address.String()),
true,
"invalid denom",
},
{
"invalid account address",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/batches/%s/balance/%s", val.APIAddress, "C01-20210101-20210201-001", "abcd"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/batches/%s/balance/%s", val.APIAddress, "C01-20210101-20210201-001", "abcd"),
true,
"decoding bech32 failed",
},
{
"valid request",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/batches/%s/balance/%s", val.APIAddress, "C01-20210101-20210201-002", val.Address.String()),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/batches/%s/balance/%s", val.APIAddress, "C01-20210101-20210201-002", val.Address.String()),
false,
"",
},
Expand Down Expand Up @@ -308,13 +308,13 @@ func (s *IntegrationTestSuite) TestGetSupply() {
}{
{
"invalid batch-denom",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/batches/%s/supply", val.APIAddress, "abcd"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/batches/%s/supply", val.APIAddress, "abcd"),
true,
"invalid denom",
},
{
"valid request",
fmt.Sprintf("%s/regen/ecocredit/v1alpha1/batches/%s/supply", val.APIAddress, "C01-20210101-20210201-001"),
fmt.Sprintf("%s/regen/ecocredit/v1alpha2/batches/%s/supply", val.APIAddress, "C01-20210101-20210201-001"),
false,
"",
},
Expand Down Expand Up @@ -347,7 +347,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() {
val := s.network.Validators[0]
require := s.Require()

resp, err := rest.GetRequest(fmt.Sprintf("%s/regen/ecocredit/v1alpha1/params", val.APIAddress))
resp, err := rest.GetRequest(fmt.Sprintf("%s/regen/ecocredit/v1alpha2/params", val.APIAddress))
require.NoError(err)

var params ecocredit.QueryParamsResponse
Expand Down
16 changes: 8 additions & 8 deletions x/ecocredit/client/testsuite/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,20 @@ func (s *IntegrationTestSuite) TestQueryBatches() {
expectedErrMsg: "Error: accepts 1 arg(s), received 2",
},
{
name: "invalid class id",
args: []string{"abcde"},
name: "invalid project id",
args: []string{"abcd-e"},
expectErr: true,
expectedErrMsg: "class ID didn't match the format",
expectedErrMsg: "invalid projectID",
},
{
name: "existing class no batches",
args: []string{"C02"},
name: "existing project no batches",
args: []string{"P02"},
expectErr: false,
expectedBatchDenoms: []string{},
},
{
name: "no pagination flags",
args: []string{"C01"},
args: []string{"P01"},
expectErr: false,
expectedBatchDenoms: []string{
"C01-20210101-20210201-001",
Expand All @@ -190,7 +190,7 @@ func (s *IntegrationTestSuite) TestQueryBatches() {
{
name: "limit 2",
args: []string{
"C01",
"P01",
fmt.Sprintf("--%s=2", flags.FlagLimit),
},
expectErr: false,
Expand All @@ -202,7 +202,7 @@ func (s *IntegrationTestSuite) TestQueryBatches() {
{
name: "limit 2, offset 2",
args: []string{
"C01",
"P01",
fmt.Sprintf("--%s=2", flags.FlagLimit),
fmt.Sprintf("--%s=2", flags.FlagOffset),
},
Expand Down
Loading