-
Notifications
You must be signed in to change notification settings - Fork 103
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/v3/client): add/update independent project CLI commands #2202
Changes from all commits
89e7630
c54af2a
d98b364
78d71e1
cf50830
0139192
4a7370e
f4146a3
864c63b
7f0af0d
f6d3f93
041af55
ea41f12
c3c15cd
d13c13c
809c089
fe74b46
1798de5
b571c1f
ad6b522
a03d165
4c81f78
89e986f
222a6af
d5feae9
4921fbe
84ac1a4
5faa1ae
72f1d54
8e58525
fc61689
5450d06
2e523c8
53fbaf6
5faccb5
9bbe3eb
7008513
81ef202
b2ad50c
0d98f57
8d0cbb4
33afc48
bff1c32
fe45d70
75616f9
18c0c7f
b29c249
e7aa7be
65a9758
6fabbf7
ea8f17b
fa5a465
6e60592
a5aa435
0aabd0b
84ba6f9
8a18b1a
1657932
8d6299f
c00ce61
c952a45
19c4aff
e97f26f
7fdcf70
8f0840d
b365045
6c837f6
7b37ed0
d089a80
a135011
7279a19
17362c0
454d7d4
47507e1
86a4180
d047dd7
cc428ad
48a9dc7
cafe075
b3a7eb3
497de7b
38b631a
4aff001
a53fe68
5d5249e
ab7cc06
5724801
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -667,3 +667,66 @@ func QueryAllowedBridgeChainsCmd() *cobra.Command { | |||||||
flags.AddPaginationFlagsToCmd(cmd, "allowed-bridge-chains") | ||||||||
return qflags(cmd) | ||||||||
} | ||||||||
|
||||||||
func QueryProjectEnrollment() *cobra.Command { | ||||||||
cmd := &cobra.Command{ | ||||||||
Use: "project-enrollment [project-id] [class-id]", | ||||||||
Short: "Retrieve project enrollment information", | ||||||||
Long: "Retrieve project enrollment information.", | ||||||||
Example: "regen q ecocredit project-enrollment P001 C01", | ||||||||
Args: cobra.ExactArgs(2), | ||||||||
RunE: func(cmd *cobra.Command, args []string) error { | ||||||||
c, ctx, err := mkQueryClient(cmd) | ||||||||
if err != nil { | ||||||||
return err | ||||||||
} | ||||||||
res, err := c.ProjectEnrollment(cmd.Context(), &types.QueryProjectEnrollmentRequest{ | ||||||||
ProjectId: args[0], | ||||||||
ClassId: args[1], | ||||||||
}) | ||||||||
return printQueryResponse(ctx, res, err) | ||||||||
}, | ||||||||
} | ||||||||
return qflags(cmd) | ||||||||
} | ||||||||
|
||||||||
func QueryProjectEnrollments() *cobra.Command { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consistency
Suggested change
|
||||||||
var projectID, classID string | ||||||||
|
||||||||
cmd := &cobra.Command{ | ||||||||
Use: "project-enrollments", | ||||||||
Short: "Retrieve project enrollments", | ||||||||
Long: `Retrieve project enrollments with optional pagination and filtering by project or credit class. | ||||||||
|
||||||||
Flags: | ||||||||
--project string Filter by project ID | ||||||||
--class string Filter by credit class ID | ||||||||
`, | ||||||||
Example: `regen q ecocredit project-enrollments --limit 10 --offset 10 | ||||||||
regen q ecocredit project-enrollments --project P001 | ||||||||
regen q ecocredit project-enrollments --class C01`, | ||||||||
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.ProjectEnrollments(cmd.Context(), &types.QueryProjectEnrollmentsRequest{ | ||||||||
ProjectId: projectID, | ||||||||
ClassId: classID, | ||||||||
Pagination: pagination, | ||||||||
}) | ||||||||
return printQueryResponse(ctx, res, err) | ||||||||
}, | ||||||||
} | ||||||||
|
||||||||
cmd.Flags().StringVar(&projectID, FlagProject, "", "Filter by project ID") | ||||||||
cmd.Flags().StringVar(&classID, FlagClass, "", "Filter by credit class ID") | ||||||||
|
||||||||
return qflags(cmd) | ||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consistency