This repository was archived by the owner on Sep 20, 2023. It is now read-only.
forked from charleenfei/ica
-
Notifications
You must be signed in to change notification settings - Fork 15
deps: upgradingto ibc-go v6-alpha1 #139
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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,35 @@ | ||
package v6 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
v6 "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/migrations/v6" | ||
) | ||
|
||
const ( | ||
// UpgradeName defines the on-chain upgrade name for the ibc-go/v6 upgrade. | ||
UpgradeName = "ibc-go/v6" | ||
) | ||
|
||
// CreateUpgradeHandler creates an upgrade handler for the ibc-go/v6 upgrade. | ||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
cdc codec.BinaryCodec, | ||
capabilityStoreKey *storetypes.KVStoreKey, | ||
capabilityKeeper *capabilitykeeper.Keeper, | ||
moduleName string, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
if err := v6.MigrateICS27ChannelCapability(ctx, cdc, capabilityStoreKey, capabilityKeeper, moduleName); err != nil { | ||
return nil, err | ||
} | ||
|
||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,10 +10,9 @@ import ( | |
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" | ||
"github.com/cosmos/interchain-accounts/x/inter-tx/keeper" | ||
|
||
channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" | ||
porttypes "github.com/cosmos/ibc-go/v5/modules/core/05-port/types" | ||
host "github.com/cosmos/ibc-go/v5/modules/core/24-host" | ||
ibcexported "github.com/cosmos/ibc-go/v5/modules/core/exported" | ||
channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types" | ||
porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types" | ||
ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported" | ||
) | ||
|
||
var _ porttypes.IBCModule = IBCModule{} | ||
|
@@ -41,11 +40,6 @@ func (im IBCModule) OnChanOpenInit( | |
counterparty channeltypes.Counterparty, | ||
version string, | ||
) (string, error) { | ||
// Claim channel capability passed back by IBC module | ||
if err := im.keeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { | ||
return "", err | ||
} | ||
|
||
return version, nil | ||
} | ||
|
||
|
@@ -101,9 +95,7 @@ func (im IBCModule) OnChanCloseConfirm( | |
return nil | ||
} | ||
|
||
// OnRecvPacket implements the IBCModule interface. A successful acknowledgement | ||
// is returned if the packet data is succesfully decoded and the receive application | ||
// logic returns without error. | ||
// OnRecvPacket implements the IBCModule interface | ||
func (im IBCModule) OnRecvPacket( | ||
ctx sdk.Context, | ||
packet channeltypes.Packet, | ||
|
@@ -157,18 +149,6 @@ func (im IBCModule) OnTimeoutPacket( | |
return nil | ||
} | ||
|
||
// NegotiateAppVersion implements the IBCModule interface | ||
func (im IBCModule) NegotiateAppVersion( | ||
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. dead code |
||
ctx sdk.Context, | ||
order channeltypes.Order, | ||
connectionID string, | ||
portID string, | ||
counterparty channeltypes.Counterparty, | ||
proposedVersion string, | ||
) (string, error) { | ||
return "", nil | ||
} | ||
|
||
func handleMsgData(ctx sdk.Context, msgData *sdk.MsgData) (string, error) { | ||
switch msgData.MsgType { | ||
case sdk.MsgTypeURL(&banktypes.MsgSend{}): | ||
|
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
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.
see: cosmos/ibc-go#2487