forked from ComposableFi/picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
951fa1b
commit 85da880
Showing
14 changed files
with
127 additions
and
17 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
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,22 @@ | ||
package v6_4_6 | ||
|
||
import ( | ||
store "github.com/cosmos/cosmos-sdk/store/types" | ||
|
||
"github.com/notional-labs/composable/v6/app/upgrades" | ||
ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" | ||
) | ||
|
||
const ( | ||
// UpgradeName defines the on-chain upgrade name for the composable upgrade. | ||
UpgradeName = "v6_4_5" | ||
) | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateUpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{ | ||
Added: []string{ibctransfermiddleware.StoreKey}, | ||
Deleted: []string{}, | ||
}, | ||
} |
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,28 @@ | ||
package v6_4_6 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/notional-labs/composable/v6/app/keepers" | ||
"github.com/notional-labs/composable/v6/app/upgrades" | ||
ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
_ upgrades.BaseAppParamManager, | ||
_ codec.Codec, | ||
keepers *keepers.AppKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
// Add params for custom middleware | ||
custommiddlewareparams := ibctransfermiddleware.DefaultGenesisState() | ||
keepers.IbcTransferMiddlewareKeeper.SetParams(ctx, custommiddlewareparams.Params) | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package v6_4_8 | ||
|
||
import ( | ||
"github.com/notional-labs/composable/v6/app/upgrades" | ||
) | ||
|
||
const ( | ||
// UpgradeName defines the on-chain upgrade name for the composable upgrade. | ||
UpgradeName = "v6_4_7" | ||
) | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateUpgradeHandler, | ||
} |
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,50 @@ | ||
package v6_4_8 | ||
|
||
import ( | ||
"github.com/CosmWasm/wasmd/x/wasm" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" | ||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" | ||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" | ||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" | ||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" | ||
"github.com/notional-labs/composable/v6/app/keepers" | ||
"github.com/notional-labs/composable/v6/app/upgrades" | ||
bech32authmigration "github.com/notional-labs/composable/v6/bech32-migration/auth" | ||
bech32govmigration "github.com/notional-labs/composable/v6/bech32-migration/gov" | ||
bech32icamigration "github.com/notional-labs/composable/v6/bech32-migration/ica" | ||
bech32mintmigration "github.com/notional-labs/composable/v6/bech32-migration/mint" | ||
bech32slashingmigration "github.com/notional-labs/composable/v6/bech32-migration/slashing" | ||
bech32stakingmigration "github.com/notional-labs/composable/v6/bech32-migration/staking" | ||
bech32transfermiddlewaremigration "github.com/notional-labs/composable/v6/bech32-migration/transfermiddleware" | ||
bech32WasmMigration "github.com/notional-labs/composable/v6/bech32-migration/wasm" | ||
transfermiddlewaretypes "github.com/notional-labs/composable/v6/x/transfermiddleware/types" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
_ upgrades.BaseAppParamManager, | ||
codec codec.Codec, | ||
keepers *keepers.AppKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
keys := keepers.GetKVStoreKey() | ||
// Migration prefix | ||
ctx.Logger().Info("First step: Migrate addresses stored in bech32 form to use new prefix") | ||
bech32stakingmigration.MigrateAddressBech32(ctx, keys[stakingtypes.StoreKey], codec) | ||
bech32stakingmigration.MigrateUnbonding(ctx, keys[stakingtypes.StoreKey], codec) | ||
bech32slashingmigration.MigrateAddressBech32(ctx, keys[slashingtypes.StoreKey], codec) | ||
bech32govmigration.MigrateAddressBech32(ctx, keys[govtypes.StoreKey], codec) | ||
bech32authmigration.MigrateAddressBech32(ctx, keys[authtypes.StoreKey], codec) | ||
bech32icamigration.MigrateAddressBech32(ctx, keys[icahosttypes.StoreKey], codec) | ||
bech32mintmigration.MigrateAddressBech32(ctx, keys[minttypes.StoreKey], codec) | ||
bech32transfermiddlewaremigration.MigrateAddressBech32(ctx, keys[transfermiddlewaretypes.StoreKey], codec) | ||
bech32WasmMigration.MigrateAddressBech32(ctx, keys[wasm.StoreKey], codec) | ||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
app/upgrades/v6_4_7/upgrades_test.go → app/upgrades/v6_4_8/upgrades_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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package v6_4_7_test | ||
package v6_4_8_test | ||
|
||
import ( | ||
"encoding/json" | ||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.