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

move ics4wrapper from keeper to ibc module #3482

Closed
wants to merge 14 commits into from

Conversation

GNaD13
Copy link
Contributor

@GNaD13 GNaD13 commented Apr 18, 2023

Description

closes: #3371

Commit Message / Changelog Entry

imp(api): remove ICS4Wrapper from keepers and pass it as argument to middleware constructor

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@faddat
Copy link
Contributor

faddat commented Apr 20, 2023

@GNaD13 please provide a commit message for this pr and btw, great work!

@GNaD13
Copy link
Contributor Author

GNaD13 commented Apr 20, 2023

@GNaD13 please provide a commit message for this pr and btw, great work!

Got it sir

@faddat
Copy link
Contributor

faddat commented Apr 20, 2023

nice :D. after I merged main, it blew up your work a bit I think, sorry

@GNaD13 GNaD13 marked this pull request as ready for review May 4, 2023 08:27
@codecov-commenter
Copy link

codecov-commenter commented May 4, 2023

Codecov Report

Merging #3482 (498cfc8) into main (dffc7b7) will decrease coverage by 0.06%.
The diff coverage is 94.28%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3482      +/-   ##
==========================================
- Coverage   78.84%   78.79%   -0.06%     
==========================================
  Files         187      186       -1     
  Lines       12948    12943       -5     
==========================================
- Hits        10209    10198      -11     
- Misses       2311     2317       +6     
  Partials      428      428              
Impacted Files Coverage Δ
modules/apps/29-fee/keeper/keeper.go 86.47% <ø> (-5.84%) ⬇️
modules/apps/29-fee/ibc_middleware.go 96.24% <93.93%> (+1.67%) ⬆️
...7-interchain-accounts/controller/ibc_middleware.go 73.40% <100.00%> (+2.43%) ⬆️

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution, @GNaD13. And sorry for the late response from our side. I left a few comments, but I would like to hear @colin-axner or @damiannolan opinion to confirm if they like this pattern.

@@ -26,7 +25,6 @@ type Keeper struct {
cdc codec.BinaryCodec

authKeeper types.AccountKeeper
ics4Wrapper porttypes.ICS4Wrapper
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to do a similar change for ics 27 controller keeper, right? That's it, we can remove the ics4Wrapper field.

// ICA Controller keeper
app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName),
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
IBCFeeMiddleware, // use ics29 fee as ics4Wrapper in middleware stack
Copy link
Contributor

Choose a reason for hiding this comment

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

See my comment above: this should not be needed anymore.

Comment on lines -486 to -493
icaControllerStack = ibcmock.NewIBCModule(&mockModule, ibcmock.NewIBCApp("", scopedICAMockKeeper))
app.ICAAuthModule = icaControllerStack.(ibcmock.IBCModule)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this changed?

ibcMockModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewIBCApp("", scopedICAMockKeeper))
app.ICAAuthModule = ibcMockModule
icaControllerMiddleware := icacontroller.NewIBCMiddleware(ibcMockModule, app.ICAControllerKeeper, app.IBCKeeper.ChannelKeeper)
icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerMiddleware, app.IBCFeeKeeper, icaControllerMiddleware)
Copy link
Contributor

Choose a reason for hiding this comment

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

We are passing here the icaControllerMiddleware twice, one for app and one for next. Do we like this pattern?

@GNaD13 GNaD13 closed this Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Remove ICS4Wrapper from keepers and pass it as argument to IBC middleware constructor
5 participants