-
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
refactor(x/ecocredit): clean up commands and examples #1288
Conversation
|
||
- name: the name used to create a bank denom for this basket token |
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.
This format improves the generated documentation rather than everything being bundled into a paragraph.
curator explicitly acknowledges paying this fee and is not surprised to learn that the | ||
paid a big fee and didn't know beforehand. | ||
- description: the description to be used in the basket coin's bank denom metadata.`), | ||
Example: `regen tx ecocredit create-basket NCT --credit-type-abbrev C --allowed_classes C01,C02 basket-fee 100000000uregen description "NCT basket"`, |
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.
I was not entirely sure on the best format for example but ultimately decided no line break before and no line break after so that it is properly formatted in the help text and the generated documentation.
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.
Also, this was the only case but no $
so that it can be easily copied.
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.
And this was also the only case, but no multiple line examples (unless multiple examples of course).
regen q ecocredit balance C01-001-20200101-20210101-001 regen1r9pl9gvr56kmclgkpjg3ynh4rm5am66f2a6y38 | ||
`, | ||
Args: cobra.ExactArgs(2), | ||
Use: "batch-balance [batch-denom] [account]", |
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.
Although balance
corresponds with the ecocredit module, we have basket and marketplace submodule commands that exist alongside the ecocredit commands so batch-balance
made more sense in this context.
I think in general we should try to match the name of the command with the message or query name but we might need to rethink client architecture with submodules and probably best to do so alongside sdk v1 updates.
regen q ecocredit supply C01-001-20200101-20210101-001 | ||
`, | ||
Args: cobra.ExactArgs(1), | ||
Use: "batch-supply [batch-denom]", |
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.
Same as batch-balance
, batch-supply
made more sense in this context.
regen query ecocredit types | ||
`, | ||
Args: cobra.ExactArgs(0), | ||
Use: "credit-types", |
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.
Same name as query method and we have credit-type
. Also more descriptive.
cmd := &cobra.Command{ | ||
Use: "buy-direct-batch [orders]", | ||
Use: "buy-direct-bulk [orders-json]", |
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.
Aligns with send-bulk
and batch
might be confusing with credit batches.
// represent a new credit batch. | ||
func TxGenBatchJSONCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: `gen-batch-json [issuer] [project-id] [issuance-count] [metadata] [start-date] [end-date]`, |
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.
Not sure how valuable this command is given we provide example JSON in create-batch
. I switched this to arguments rather than flags but maybe flags were being used because of the number of arguments. Although all are required and to be consistent with how we are using flags, arguments made more sense to me.
Codecov Report
@@ Coverage Diff @@
## master #1288 +/- ##
==========================================
+ Coverage 77.29% 77.57% +0.28%
==========================================
Files 212 212
Lines 16110 15973 -137
==========================================
- Hits 12452 12391 -61
+ Misses 2661 2593 -68
+ Partials 997 989 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
lgtm - most of my review comments arent really related to the changes but figured we could clean em up here anyway 😄
* refactor(x/ecocredit): clean up commands and command examples * refactor(x/ecocredit): clean up commands and command examples * fix format and import * update credit types query * Apply suggestions from code review Co-authored-by: Tyler <[email protected]> * update changelog * improve basket query examples and update test batch denom Co-authored-by: Tyler <[email protected]> (cherry picked from commit 5ce8e9e)
* refactor(x/ecocredit): clean up commands and command examples * refactor(x/ecocredit): clean up commands and command examples * fix format and import * update credit types query * Apply suggestions from code review Co-authored-by: Tyler <[email protected]> * update changelog * improve basket query examples and update test batch denom Co-authored-by: Tyler <[email protected]> (cherry picked from commit 5ce8e9e) Co-authored-by: Ryan Christoffersen <[email protected]>
Description
Closes: #1271
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change