-
Notifications
You must be signed in to change notification settings - Fork 625
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
96a5d9e
imp(ica, transfer): added WithICS4Wrapper api function
srdtrk bf28b28
docs(ica, transfer): updated 'WithICS4Wrapper's godocs
srdtrk 3a73bbf
docs(adr8): updated godocs for withics4wrapper
srdtrk 390cecb
imp(ica/host): removed withics4wrapper from icahost
srdtrk ce80a3e
style(ica, tranfer): ran golanci-lint
srdtrk f3a3477
imp(ica/controller_test): added WithICS4Wrapper test
srdtrk 7685afb
imp(transfer_test): added WithICS4Wrapper test
srdtrk f4d4a33
style(transfer_test, ica/controller_test): added spacing to TestWithI…
srdtrk 4e4f4ec
merge: branch 'main' into serdar/with-ics4wrapper
srdtrk eb0ed52
feat(ica/host): implemented 'WithICS4Wrapper'
srdtrk 7f00e77
feat(fee): implemented 'WithICS4Wrapper'
srdtrk 0404748
merge: branch 'main' into serdar/with-ics4wrapper
srdtrk 5581b5a
merge: branch 'main' into serdar/with-ics4wrapper
srdtrk 30d4129
Merge branch 'main' into serdar/with-ics4wrapper
srdtrk 39cf1e1
Merge branch 'main' into serdar/with-ics4wrapper
srdtrk fe84a21
Merge branch 'main' into serdar/with-ics4wrapper
srdtrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
modules/apps/27-interchain-accounts/controller/keeper/export_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package keeper | ||
|
||
/* | ||
This file is to allow for unexported functions and fields to be accessible to the testing package. | ||
*/ | ||
|
||
import porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" | ||
|
||
// GetICS4Wrapper is a getter for the keeper's ICS4Wrapper. | ||
func (k *Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper { | ||
return k.ics4Wrapper | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
modules/apps/27-interchain-accounts/host/keeper/export_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package keeper | ||
|
||
/* | ||
This file is to allow for unexported functions and fields to be accessible to the testing package. | ||
*/ | ||
|
||
import porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" | ||
|
||
// GetICS4Wrapper is a getter for the keeper's ICS4Wrapper. | ||
func (k *Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper { | ||
return k.ics4Wrapper | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,9 @@ import ( | |
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper" | ||
"github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" | ||
channelkeeper "github.com/cosmos/ibc-go/v7/modules/core/04-channel/keeper" | ||
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" | ||
ibctesting "github.com/cosmos/ibc-go/v7/testing" | ||
ibcmock "github.com/cosmos/ibc-go/v7/testing/mock" | ||
|
@@ -297,3 +299,24 @@ func (suite *KeeperTestSuite) TestGetAllCounterpartyPayees() { | |
suite.Require().Len(counterpartyPayeeAddr, len(expectedCounterpartyPayee)) | ||
suite.Require().Equal(counterpartyPayeeAddr, expectedCounterpartyPayee) | ||
} | ||
|
||
func (suite *KeeperTestSuite) TestWithICS4Wrapper() { | ||
suite.SetupTest() | ||
|
||
// test if the ics4 wrapper is the channel keeper initially | ||
ics4Wrapper := suite.chainA.GetSimApp().IBCFeeKeeper.GetICS4Wrapper() | ||
|
||
_, isChannelKeeper := ics4Wrapper.(channelkeeper.Keeper) | ||
suite.Require().True(isChannelKeeper) | ||
_, isFeeKeeper := ics4Wrapper.(keeper.Keeper) | ||
suite.Require().False(isFeeKeeper) | ||
|
||
// set the ics4 wrapper to itself (don't do this in production) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😄 |
||
suite.chainA.GetSimApp().IBCFeeKeeper.WithICS4Wrapper(suite.chainA.GetSimApp().IBCFeeKeeper) | ||
ics4Wrapper = suite.chainA.GetSimApp().IBCFeeKeeper.GetICS4Wrapper() | ||
|
||
_, isFeeKeeper = ics4Wrapper.(keeper.Keeper) | ||
suite.Require().True(isFeeKeeper) | ||
_, isChannelKeeper = ics4Wrapper.(channelkeeper.Keeper) | ||
suite.Require().False(isChannelKeeper) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package keeper | ||
|
||
/* | ||
This file is to allow for unexported functions and fields to be accessible to the testing package. | ||
*/ | ||
|
||
import porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" | ||
|
||
// GetICS4Wrapper is a getter for the keeper's ICS4Wrapper. | ||
func (k *Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper { | ||
return k.ics4Wrapper | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 😅