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

imp(apps): added 'WithICS4Wrapper' function to keepers #4187

Merged
merged 16 commits into from
Jul 31, 2023

Conversation

srdtrk
Copy link
Member

@srdtrk srdtrk commented Jul 27, 2023

Description

This is first one of the upcoming PRs requested by @colin-axner to reduce the diff when reviewing #3939

This function allows to set the middleware after the keeper's creation.

closes: #XXXX

Commit Message / Changelog Entry

imp(apps): added 'WithICS4Wrapper' function to keepers

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.

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2023

Codecov Report

Merging #4187 (fe84a21) into main (4e1e594) will increase coverage by 0.01%.
Report is 5 commits behind head on main.
The diff coverage is 92.30%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4187      +/-   ##
==========================================
+ Coverage   79.45%   79.46%   +0.01%     
==========================================
  Files         188      188              
  Lines       12990    12969      -21     
==========================================
- Hits        10321    10306      -15     
+ Misses       2240     2234       -6     
  Partials      429      429              
Files Changed Coverage Δ
modules/core/03-connection/types/codec.go 100.00% <ø> (ø)
modules/core/03-connection/types/connection.go 76.81% <0.00%> (ø)
...27-interchain-accounts/controller/keeper/keeper.go 90.74% <100.00%> (+0.11%) ⬆️
.../apps/27-interchain-accounts/host/keeper/keeper.go 85.60% <100.00%> (+0.22%) ⬆️
...ules/apps/27-interchain-accounts/types/metadata.go 78.49% <100.00%> (-1.71%) ⬇️
modules/apps/29-fee/keeper/keeper.go 92.38% <100.00%> (+0.07%) ⬆️
modules/apps/transfer/keeper/keeper.go 90.62% <100.00%> (+0.14%) ⬆️
modules/core/03-connection/keeper/handshake.go 88.58% <100.00%> (ø)
modules/core/03-connection/keeper/keeper.go 90.37% <100.00%> (ø)
modules/core/03-connection/types/version.go 96.20% <100.00%> (+5.67%) ⬆️
... and 1 more

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

LGTM! I think this is a good short term fix until we cleanup middleware wiring. Should we add this for ics29 as well?

@srdtrk
Copy link
Member Author

srdtrk commented Jul 27, 2023

In that case, should I add it to icahost too @colin-axner?

@colin-axner
Copy link
Contributor

In that case, should I add it to icahost too @colin-axner?

Good question. It's not necessary, but it might be nice to do for consistency sake. It's useful to define the ics4wrapper after generating all the ibc modules. So I would be in favour of doing so, but I can go either way. Happy to wait to hear if others have an opinion next week

@srdtrk srdtrk requested a review from charleenfei as a code owner July 27, 2023 16:17
@srdtrk srdtrk changed the title imp(transfer, ica/controller): added 'WithICS4Wrapper' function to keeper imp(apps): added 'WithICS4Wrapper' function to keepers Jul 27, 2023
Comment on lines +69 to +71
// WithICS4Wrapper sets the ICS4Wrapper. This function may be used after
// the keepers creation to set the middleware which is above this module
// in the IBC application stack.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I would try to elaborate a bit more in what circumstances you would use this function.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't think of other circumstances 😅

_, isFeeKeeper := ics4Wrapper.(keeper.Keeper)
suite.Require().False(isFeeKeeper)

// set the ics4 wrapper to itself (don't do this in production)
Copy link
Contributor

Choose a reason for hiding this comment

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

😄

@srdtrk srdtrk merged commit 561eb36 into main Jul 31, 2023
53 checks passed
@srdtrk srdtrk deleted the serdar/with-ics4wrapper branch July 31, 2023 14:30
mergify bot pushed a commit that referenced this pull request Jul 31, 2023
* imp(ica, transfer): added WithICS4Wrapper api function

* docs(ica, transfer): updated 'WithICS4Wrapper's godocs

* docs(adr8): updated godocs for withics4wrapper

* imp(ica/host): removed withics4wrapper from icahost

* style(ica, tranfer): ran golanci-lint

* imp(ica/controller_test): added WithICS4Wrapper test

* imp(transfer_test): added WithICS4Wrapper test

* style(transfer_test, ica/controller_test): added spacing to TestWithICS4Wrapper

* feat(ica/host): implemented 'WithICS4Wrapper'

* feat(fee): implemented 'WithICS4Wrapper'

(cherry picked from commit 561eb36)

# Conflicts:
#	modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go
#	modules/apps/27-interchain-accounts/host/keeper/keeper_test.go
#	modules/apps/transfer/keeper/keeper.go
#	modules/apps/transfer/keeper/keeper_test.go
srdtrk added a commit that referenced this pull request Aug 1, 2023
… (#4210)

* imp(apps): added 'WithICS4Wrapper' function to keepers (#4187)

* imp(ica, transfer): added WithICS4Wrapper api function

* docs(ica, transfer): updated 'WithICS4Wrapper's godocs

* docs(adr8): updated godocs for withics4wrapper

* imp(ica/host): removed withics4wrapper from icahost

* style(ica, tranfer): ran golanci-lint

* imp(ica/controller_test): added WithICS4Wrapper test

* imp(transfer_test): added WithICS4Wrapper test

* style(transfer_test, ica/controller_test): added spacing to TestWithICS4Wrapper

* feat(ica/host): implemented 'WithICS4Wrapper'

* feat(fee): implemented 'WithICS4Wrapper'

(cherry picked from commit 561eb36)

# Conflicts:
#	modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go
#	modules/apps/27-interchain-accounts/host/keeper/keeper_test.go
#	modules/apps/transfer/keeper/keeper.go
#	modules/apps/transfer/keeper/keeper_test.go

* fix: fixed backport conflicts

---------

Co-authored-by: srdtrk <[email protected]>
Co-authored-by: srdtrk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants