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: WrappedPreBlocker #567

Merged
merged 10 commits into from
Jul 2, 2024

Conversation

technicallyty
Copy link
Contributor

@technicallyty technicallyty commented Jul 1, 2024

previously, simapp would not work with x/upgrade handlers. this is because upgrades rely on PreBlocker but this was being overwritten with the oracle PreBlocker.

fixed by creating a new method on oracle's PreBlockHandler: "WrappedPreBlocker" which takes a module.Manager, and call the PreBlock function to trigger upgrades. h/t @aljo242 for showing me the way

i added a comment to the existing PreBlocker that notes it is deprecated and to use WrappedPreBlocker instead.

Copy link
Contributor

@nivasan1 nivasan1 left a comment

Choose a reason for hiding this comment

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

lgtm

tests/simapp/app.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 2 lines in your changes missing coverage. Please review.

Project coverage is 56.38%. Comparing base (158cde8) to head (c05300c).
Report is 1 commits behind head on main.

Current head c05300c differs from pull request most recent head 6ff52fb

Please upload reports for the commit 6ff52fb to get more accurate results.

Files Patch % Lines
abci/preblock/oracle/preblock.go 95.45% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #567      +/-   ##
==========================================
- Coverage   56.57%   56.38%   -0.20%     
==========================================
  Files         246      246              
  Lines       12506    12550      +44     
==========================================
+ Hits         7075     7076       +1     
- Misses       4731     4773      +42     
- Partials      700      701       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@technicallyty technicallyty changed the title fix: simapp not working with x/upgrade handlers refactor: make PreBlockHandler's PreBlock call module manager's PreBlock Jul 1, 2024
@technicallyty technicallyty requested a review from nivasan1 July 1, 2024 17:40
@technicallyty technicallyty changed the title refactor: make PreBlockHandler's PreBlock call module manager's PreBlock refactor!: make PreBlockHandler's PreBlock call module manager's PreBlock Jul 1, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i just switched all the tests over to the non-deprecated version of the method, and added a case to ensure PreBlock from ModuleManager is actually called. lmk if this is ideal or not!

@technicallyty technicallyty requested a review from davidterpay July 1, 2024 20:12
@technicallyty technicallyty changed the title refactor!: make PreBlockHandler's PreBlock call module manager's PreBlock feat: WrappedPreBlocker Jul 1, 2024
@technicallyty technicallyty merged commit 793b2e8 into main Jul 2, 2024
14 checks passed
@technicallyty technicallyty deleted the tyler/blo-1459-simapp-doesnt-work-with-xupgrade branch July 2, 2024 16:06
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.

4 participants