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 query methods for orm params #1423

Merged
merged 16 commits into from
Aug 30, 2022

Conversation

aleem1314
Copy link
Contributor

@aleem1314 aleem1314 commented Aug 29, 2022

Description

Closes: #1402


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 29, 2022 14:35
@aleem1314 aleem1314 requested a review from a team August 29, 2022 14:35
proto/regen/ecocredit/v1/query.proto Outdated Show resolved Hide resolved
x/ecocredit/client/query.go Outdated Show resolved Hide resolved
x/ecocredit/genesis/genesis.go Show resolved Hide resolved
x/ecocredit/server/core/query_credit_class_fees_test.go Outdated Show resolved Hide resolved
x/ecocredit/server/core/query_credit_class_fees_test.go Outdated Show resolved Hide resolved
@ryanchristo ryanchristo changed the title feat(ecocredit): add query methods for orm params feat(x/ecocredit): add query methods for orm params Aug 29, 2022
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.

Looking good.

CHANGELOG.md Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/query.proto Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/query.proto Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/query.proto Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/query.proto Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/query.proto Show resolved Hide resolved
x/ecocredit/client/query.go Outdated Show resolved Hide resolved
aleem1314 and others added 10 commits August 30, 2022 11:14
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>
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Aug 30, 2022

Codecov Report

Merging #1423 (f7bd8c9) into main (2ac14ac) will increase coverage by 0.03%.
The diff coverage is 76.06%.

❗ Current head f7bd8c9 differs from pull request most recent head 28cd0e6. Consider uploading reports for the commit 28cd0e6 to get more accurate results

@@            Coverage Diff             @@
##             main    #1423      +/-   ##
==========================================
+ Coverage   78.54%   78.58%   +0.03%     
==========================================
  Files         236      240       +4     
  Lines       18109    18360     +251     
==========================================
+ Hits        14224    14428     +204     
- Misses       3076     3104      +28     
- Partials      809      828      +19     
Impacted Files Coverage Δ
x/ecocredit/server/genesis.go 53.84% <ø> (+9.66%) ⬆️
x/ecocredit/genesis/genesis.go 41.19% <35.71%> (-0.40%) ⬇️
x/ecocredit/server/core/query_credit_class_fees.go 50.00% <50.00%> (ø)
...credit/server/core/query_allowed_class_creators.go 53.84% <53.84%> (ø)
x/ecocredit/server/core/query_allowlist_enabled.go 62.50% <62.50%> (ø)
x/ecocredit/server/core/query_params.go 55.73% <66.66%> (+4.57%) ⬆️
x/ecocredit/client/query.go 62.26% <71.69%> (+3.60%) ⬆️
x/ecocredit/module/module.go 56.42% <75.00%> (-0.93%) ⬇️
x/ecocredit/basket/default.go 100.00% <100.00%> (ø)
x/ecocredit/client/testsuite/query.go 99.51% <100.00%> (+0.03%) ⬆️
... and 83 more

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.

Looks good. Nice work! One quick question/suggestion.

Comment on lines +592 to +605
// AllowedDenom represents the information for an allowed ask denom.
message AllowedDenomInfo {
// denom is the bank denom to allow (ex. ibc/GLKHDSG423SGS)
string bank_denom = 1;

// display_denom is the denom to display to the user and is informational.
// Because the denom is likely an IBC denom, this should be chosen by
// governance to represent the consensus trusted name of the denom.
string display_denom = 2;

// exponent is the exponent that relates the denom to the display_denom and is
// informational
uint32 exponent = 3;
}
Copy link
Member

Choose a reason for hiding this comment

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

All the values provided in the AllowedDenom state message are already human-readable (i.e. there are no byte addresses that need to be converted to strings). Any reason for defining a separate message here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially I tried using AllowedDenom from the marketplace, but that is creating import cycles.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, ok. I see. Yea, this seems ok. We could also embed this within the QueryParamsResponse message given this is not native to the ecocredit.v1 package but we still need to define it separately. Ok to leave as is though.

Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this query actually go in proto/regen/ecocredit/marketplace/v1?

Copy link
Member

Choose a reason for hiding this comment

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

It's the Params query that will be deprecated but Params is in ecocredit.v1.

Copy link
Member

Choose a reason for hiding this comment

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

The main issue is if we have a query for params, it should return all params. The alternative is removing it and requiring users to use individual queries but keeping the params query for one more release seemed nice to have.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is ok for now. I can also clean up param proto messages a bit when updating the param names.

x/ecocredit/server/core/query_params.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.

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.

LGTM

@ryanchristo ryanchristo merged commit ac52762 into main Aug 30, 2022
@ryanchristo ryanchristo deleted the aleem/1402-params-query branch August 30, 2022 17:33
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.

Individual query methods for new ORM params
3 participants