-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop2' of https://github.com/ComposableFi/composable…
…-cosmos into branch-v6.6.1
- Loading branch information
Showing
7 changed files
with
134 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ import ( | |
) | ||
|
||
const ( | ||
Name = "picasso" | ||
Name = "pica" | ||
dirName = "banksy" | ||
ForkHeight = 244008 | ||
) | ||
|
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,29 @@ | ||
package ibchooks | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/notional-labs/composable/v6/bech32-migration/utils" | ||
) | ||
|
||
func MigrateAddressBech32(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) { | ||
ctx.Logger().Info("Migration of address bech32 for ibchooks module begin") | ||
totalAddr := uint64(0) | ||
store := ctx.KVStore(storeKey) | ||
channelKey := []byte("channel") | ||
iterator := sdk.KVStorePrefixIterator(store, channelKey) | ||
for ; iterator.Valid(); iterator.Next() { | ||
totalAddr++ | ||
fullKey := iterator.Key() | ||
contract := string(store.Get(fullKey)) | ||
contract = utils.SafeConvertAddress(contract) | ||
totalAddr++ | ||
store.Set(fullKey, []byte(contract)) | ||
} | ||
|
||
ctx.Logger().Info( | ||
"Migration of address bech32 for ibchooks module done", | ||
"totalAddr", totalAddr, | ||
) | ||
} |
32 changes: 32 additions & 0 deletions
32
bech32-migration/ibctransfermiddleware/ibctransfermiddleware.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,32 @@ | ||
package ibctransfermiddleware | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/notional-labs/composable/v6/bech32-migration/utils" | ||
"github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" | ||
) | ||
|
||
func MigrateAddressBech32(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) { | ||
ctx.Logger().Info("Migration of address bech32 for ibctransfermiddleware module begin") | ||
totalAddr := uint64(0) | ||
store := ctx.KVStore(storeKey) | ||
bz := store.Get(types.ParamsKey) | ||
if bz == nil { | ||
return | ||
} | ||
var params types.Params | ||
cdc.MustUnmarshal(bz, ¶ms) | ||
for i := range params.ChannelFees { | ||
totalAddr++ | ||
params.ChannelFees[i].FeeAddress = utils.SafeConvertAddress(params.ChannelFees[i].FeeAddress) | ||
} | ||
bz = cdc.MustMarshal(¶ms) | ||
store.Set(types.ParamsKey, bz) | ||
|
||
ctx.Logger().Info( | ||
"Migration of address bech32 for ibctransfermiddleware module done", | ||
"totalAddr", totalAddr, | ||
) | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package slashing | ||
package ica | ||
|
||
import ( | ||
"strings" | ||
|
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