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

refactor: memo parsing logic in ibc_packet_handlers.go #321

Merged
merged 6 commits into from
Mar 3, 2023

Conversation

aljo242
Copy link

@aljo242 aljo242 commented Feb 24, 2023

1. Summary

refactor duplicated logic in x/interchainstaking/keeper/ibc_packet_handlers.go into a types package.

2.Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

3. Implementation details

  • Refactor duplicated code into types package
  • add tests
  • add fuzz tests

4. How to test/use

To run the fuzz test:

go test -fuzz=FuzzParseMsgMemo github.com/ingenuity-build/quicksilver/x/interchainstaking/types -fuzztime=5m 

5. Checklist

  • Does the Readme need to be updated?

6. Limitations (optional)

7. Future Work (optional)

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2023

Codecov Report

Merging #321 (69ef6a9) into main (f5897f4) will increase coverage by 0.08%.
The diff coverage is 76.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   56.22%   56.31%   +0.08%     
==========================================
  Files         153      154       +1     
  Lines       12057    12051       -6     
==========================================
+ Hits         6779     6786       +7     
+ Misses       4805     4795      -10     
+ Partials      473      470       -3     
Flag Coverage Δ
unittests 56.31% <76.47%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
x/interchainstaking/keeper/ibc_packet_handlers.go 31.37% <42.85%> (+0.22%) ⬆️
x/interchainstaking/types/ibc_packet.go 100.00% <100.00%> (ø)

Copy link
Contributor

@joe-bowman joe-bowman 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 overall, but as discussed there seems to be no difference between the fuzz test and the unit test here in terms of coverage. As fuzz tests are not currently run on every push, and the unit test is not resource intensive, should be just keep that?

@ajansari95
Copy link
Contributor

Looks good overall, but as discussed there seems to be no difference between the fuzz test and the unit test here in terms of coverage. As fuzz tests are not currently run on every push, and the unit test is not resource intensive, should be just keep that?

i think we can add a fuzz test target in make file and not include in coverage?

@aljo242
Copy link
Author

aljo242 commented Mar 2, 2023

@ajansari95 @joe-bowman makes most sense to remove the fuzz test in this case because as @joe-bowman mentioned, its not giving us much more than the unit test which we are running all of the time.

@aljo242 aljo242 requested a review from joe-bowman March 3, 2023 11:58
Copy link
Contributor

@joe-bowman joe-bowman 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

@ajansari95 ajansari95 left a comment

Choose a reason for hiding this comment

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

LGTM

@aljo242 aljo242 merged commit cd4b82b into main Mar 3, 2023
@aljo242 aljo242 deleted the chore/ibc-packet-cleanup branch March 3, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants