-
Notifications
You must be signed in to change notification settings - Fork 619
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: always set ics27 ports regardless of whether the capability exists #4640
Conversation
… exists Add e2e to test integration points. Refactor persisted port state to be separate from port binding/creation
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.
copy/pasted from ics27 tests
@@ -62,7 +62,8 @@ func (k Keeper) registerInterchainAccount(ctx sdk.Context, connectionID, portID, | |||
case k.portKeeper.IsBound(ctx, portID) && !k.hasCapability(ctx, portID): | |||
return "", errorsmod.Wrapf(icatypes.ErrPortAlreadyBound, "another module has claimed capability for and bound port with portID: %s", portID) | |||
case !k.portKeeper.IsBound(ctx, portID): | |||
capability := k.BindPort(ctx, portID) | |||
k.setPort(ctx, portID) |
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.
ideally gets removed #4638 in the future
@@ -123,19 +122,20 @@ func NewAppModule(controllerKeeper *controllerkeeper.Keeper, hostKeeper *hostkee | |||
// called once and as an alternative to InitGenesis. | |||
func (am AppModule) InitModule(ctx sdk.Context, controllerParams controllertypes.Params, hostParams hosttypes.Params) { |
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.
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.
Awesome, thank you @colin-axner! ❤️
Hopefully we can address these issues sooner rather than later :)
for _, port := range ports { | ||
store := suite.chainA.GetContext().KVStore(suite.chainA.GetSimApp().GetKey(icacontrollertypes.StoreKey)) | ||
suite.Require().True(store.Has(icatypes.KeyPort(port))) | ||
|
||
capability, found := suite.chainA.GetSimApp().ScopedICAControllerKeeper.GetCapability(suite.chainA.GetContext(), host.PortPath(port)) | ||
suite.Require().True(found) | ||
suite.Require().NotNil(capability) | ||
} | ||
}) |
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.
this is the main thing added
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" | ||
host "github.com/cosmos/ibc-go/v8/modules/core/24-host" | ||
ibctesting "github.com/cosmos/ibc-go/v8/testing" | ||
) | ||
|
||
func (suite *KeeperTestSuite) TestInitGenesis() { |
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.
it's really hard to test both setups of capabilities already being initialized or not being initialized as the testing pkg will call init genesis first and the portID is hard coded. I personally think this sort of integration testing is better handled by the e2e's which is why I added coverage there
…c-go into colin/4626-ica-initgenesis-fix
@@ -5,11 +5,29 @@ import ( | |||
"github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" | |||
genesistypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/genesis/types" | |||
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" | |||
host "github.com/cosmos/ibc-go/v8/modules/core/24-host" | |||
ibctesting "github.com/cosmos/ibc-go/v8/testing" | |||
) | |||
|
|||
func (suite *KeeperTestSuite) TestInitGenesis() { |
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.
Table tests ++ 💪
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4640 +/- ##
==========================================
+ Coverage 79.53% 79.56% +0.03%
==========================================
Files 188 188
Lines 13191 13201 +10
==========================================
+ Hits 10492 10504 +12
+ Misses 2267 2266 -1
+ Partials 432 431 -1
|
…relayer support across genesis retarts
e2e/tests/upgrades/genesis_test.go
Outdated
@@ -180,17 +180,6 @@ func (s *GenesisTestSuite) TestIBCGenesis() { | |||
|
|||
s.Require().NoError(test.WaitForBlocks(ctx, 10, chainA, chainB)) | |||
}) | |||
|
|||
t.Run("verify tokens transferred", func(t *testing.T) { |
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.
this should be added with #3476
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.
Thanks for creating those clean-up issues, LGTM 👍
Description
Need to update genesis unit tests
closes: #4626
Commit Message / Changelog Entry
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.
docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.