-
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): credit type gov handler #1015
Conversation
😱 not sure what this is?? |
Codecov Report
@@ Coverage Diff @@
## master #1015 +/- ##
==========================================
+ Coverage 59.74% 59.85% +0.10%
==========================================
Files 226 231 +5
Lines 22765 22840 +75
==========================================
+ Hits 13601 13670 +69
- Misses 7843 7844 +1
- Partials 1321 1326 +5
Flags with carried forward coverage won't be shown. Click here to find out more. |
Looks like something to do with cosmwasm. Might be related to. |
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 suggest to better separate integration tests from unit tests, and to the latter at the unit level.
if len(m.Unit) == 0 { | ||
return sdkerrors.ErrInvalidRequest.Wrap("unit cannot be empty") | ||
} |
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 think #429 would be nice to have alongside these updates but this could be added as a followup.
Co-authored-by: Ryan Christoffersen <[email protected]>
…regen-network/regen-ledger into ty/1005-credit_type_gov_handler
x/ecocredit/client/core/proposal.go
Outdated
|
||
func TxCreditTypeProposalCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "credit-type-proposal [proposal-title] [proposal-description] [credit_type_abbreviation] [credit_type_name] [units] [precision] [flags]", |
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 seems like a lot of positional arguments. I think we shouldn't even implement this and just let people submit a JSON proposal. I don't expect this to be called more than 5-10 times ever in production
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.
is that how most folks submit proposals? i could change it to a single argument (json file)
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 think aaron is referring to the gov command:
regen tx gov submit-proposal --proposal="path/to/proposal.json" --from mykey
Where proposal.json
includes:
{
"title": "Add Biochar Credit Type",
"description": "Add Biochar credit type to the list of allowed credit types",
"type": "CreditTypeProposal",
"credit_type": {
"abbreviation": "BC",
"name": "biochar",
"unit": "tonnes of organic carbon",
"precision": 6,
},
"deposit": "10regen"
}
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'm not sure if the above works and it should be tested before removing the command implemented here. If not, I think a json or yaml file might be nice.
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.
ah ok didn't know of that one. removed the cli command - fa42e6d
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.
Does it work?
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.
didnt see your last comment 🥲, wasn't able to get this working. maybe we can take a look tomorrows standup? can just revert the removal if we cant get it going
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.
Sounds good. Let's try tomorrow and then revert if we can't get it going.
Co-authored-by: Aaron Craelius <[email protected]>
…regen-network/regen-ledger into ty/1005-credit_type_gov_handler
This reverts commit fa42e6d.
Moving forward, we will treat cli tests as a last priority and as a nice to have in the backlog. |
Description
x/ecocredit
andx/ecocredit/core
fTo reduce diff footprint, i've added follow ups here: #1016
Closes: #1005
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