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)!: migrate core params to ORM #1354

Merged
merged 31 commits into from
Aug 25, 2022

Conversation

aleem1314
Copy link
Contributor

@aleem1314 aleem1314 commented Aug 16, 2022

Description

Closes: #729


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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@aleem1314 aleem1314 marked this pull request as ready for review August 18, 2022 14:57
@aleem1314 aleem1314 requested a review from a team August 18, 2022 14:57
Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! This is looking good. The main change I think we should make is adding and removing a single credit class creator rather than a list of credit class creators. Updating this list will not be frequent and each address added or removed warrants its own proposal. It is technically possible to include multiple updates with multiple messages but we don't want to encourage this behavior but rather one address per proposal.

proto/regen/ecocredit/v1/tx.proto Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/tx.proto Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/tx.proto Outdated Show resolved Hide resolved
Comment on lines +660 to +665
// creation fee.
repeated cosmos.base.v1beta1.Coin fees = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for now but tagging #1359 for reference.

x/ecocredit/core/features/msg_add_class_creators.feature Outdated Show resolved Hide resolved
x/ecocredit/server/core/msg_create_class_test.go Outdated Show resolved Hide resolved
x/ecocredit/server/core/msg_create_class_test.go Outdated Show resolved Hide resolved
x/ecocredit/server/core/msg_create_class_test.go Outdated Show resolved Hide resolved
aleem1314 and others added 8 commits August 23, 2022 10:52
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
…ature

Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
…ature

Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
…ature

Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good. A lot to changes here. It would be nice to tackle updates like this in multiple pull requests in the future, maybe one for each new feature (in this case each param). I've added some more questions and suggestions.

CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines +134 to +139
// ToggleCreditClassAllowlist is a governance method that toggles the network
// allowlist to on or off. when on, the class creator allowlist is used to
// enforce which addresses may create classes. when off, any address may
// create classes. Since Revision 1
rpc ToggleCreditClassAllowlist(MsgToggleCreditClassAllowlist)
returns (MsgToggleCreditClassAllowlistResponse);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be ToggleClassCreatorAllowlist but we may also want to update based on #1387 so this is ok for now to keep things moving and I've added a comment in the issue #1387 (comment).

x/ecocredit/server/core/msg_create_class_test.go Outdated Show resolved Hide resolved
x/ecocredit/server/core/msg_add_class_creator_test.go Outdated Show resolved Hide resolved
x/ecocredit/server/core/msg_remove_class_creators_test.go Outdated Show resolved Hide resolved
Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK. Very nice work!

Comment on lines +59 to +65
return &core.QueryParamsResponse{
Params: &core.Params{
AllowedClassCreators: creators,
AllowlistEnabled: allowlistEnabled.Enabled,
CreditClassFee: classFees1,
BasketFee: basketFees1,
},
Copy link
Member

@ryanchristo ryanchristo Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. We should add individual queries for these params but also keep this for the time being. We may also want to consider adding the other params here so that this is not misleading, in which case we would need to update the param struct to include the other params but also deprecate it. I'll open a separate issue for tracking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nits, preapproving

types/coin.go Show resolved Hide resolved
x/ecocredit/server/core/msg_create_class.go Show resolved Hide resolved
x/ecocredit/server/core/msg_remove_class_creators.go Outdated Show resolved Hide resolved
@ryanchristo ryanchristo merged commit 4951cc3 into main Aug 25, 2022
@ryanchristo ryanchristo deleted the aleem/core-params-migration branch August 25, 2022 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ecocredit ORM params
3 participants