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

fix(x/ecocredit): fix core message validation and update tests #1233

Merged
merged 7 commits into from
Jul 7, 2022

Conversation

ryanchristo
Copy link
Member

@ryanchristo ryanchristo commented Jul 4, 2022

Description

Ref: #893


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)

@codecov
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #1233 (7dfe792) into master (1e3c173) will increase coverage by 0.11%.
The diff coverage is 95.45%.

@@            Coverage Diff             @@
##           master    #1233      +/-   ##
==========================================
+ Coverage   79.65%   79.76%   +0.11%     
==========================================
  Files         230      231       +1     
  Lines       21444    21476      +32     
==========================================
+ Hits        17081    17131      +50     
- Misses       3007     3008       +1     
+ Partials     1356     1337      -19     
Flag Coverage Δ
experimental-codecov 79.78% <95.45%> (+0.14%) ⬆️
stable-codecov 74.84% <95.45%> (+0.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
x/ecocredit/core/types_credit_type.go 100.00% <ø> (ø)
x/ecocredit/core/msg_update_project_metadata.go 85.71% <75.00%> (+2.38%) ⬆️
x/ecocredit/core/msg_update_project_admin.go 87.50% <81.81%> (ø)
x/ecocredit/core/msg_cancel.go 87.50% <100.00%> (+37.50%) ⬆️
x/ecocredit/core/msg_retire.go 87.50% <100.00%> (+25.00%) ⬆️
x/ecocredit/core/msg_seal_batch.go 50.00% <100.00%> (+5.55%) ⬆️
x/ecocredit/core/msg_send.go 92.85% <100.00%> (+38.31%) ⬆️
x/ecocredit/core/msg_update_class_admin.go 87.50% <100.00%> (+30.35%) ⬆️
x/ecocredit/core/msg_update_class_issuers.go 92.85% <100.00%> (+26.19%) ⬆️
x/ecocredit/core/msg_update_class_metadata.go 85.71% <100.00%> (+35.71%) ⬆️
... and 10 more

* fix(x/ecocredit): bridge and bridge receive message validation

* add and update tests

* add ethereum contract scenario

* use sdkerros wrap not fmt

* use steps for field length checks

* use custom regen prefix
@ryanchristo ryanchristo marked this pull request as ready for review July 7, 2022 04:34
Copy link
Contributor

@aleem1314 aleem1314 left a comment

Choose a reason for hiding this comment

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

lgtm

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 - nit: some other areas similar to the review comment below- might be nice to add the empty check in the Validate<Field> functions

Comment on lines +40 to +41
if m.Jurisdiction == "" {
return sdkerrors.ErrInvalidRequest.Wrap("jurisdiction cannot be empty")
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this is something we can catch in ValidateJurisdiction? ok either way or perhaps a followup PR

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, I was thinking the same thing but I think a followup would be better. Opened #1245.

@ryanchristo ryanchristo merged commit 93b67aa into master Jul 7, 2022
@ryanchristo ryanchristo deleted the ryan/893-core-msg-validation-2 branch July 7, 2022 18:48
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.

3 participants