Skip to content

Commit

Permalink
Merge pull request #443 from ComposableFi/prop_migration
Browse files Browse the repository at this point in the history
Remove Proposal 6 from storage
  • Loading branch information
kkast committed Feb 13, 2024
2 parents ec27a77 + f1b41a5 commit 6a87f21
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- main
- develop

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/bank"

"github.com/notional-labs/composable/v6/app/keepers"
v6_4_4 "github.com/notional-labs/composable/v6/app/upgrades/v6_4_4"
"github.com/notional-labs/composable/v6/app/upgrades/v6_4_5"

// bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"

Expand Down Expand Up @@ -144,7 +144,7 @@ var (
// https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
EnableSpecificProposals = ""

Upgrades = []upgrades.Upgrade{v6_4_4.Upgrade}
Upgrades = []upgrades.Upgrade{v6_4_5.Upgrade}
Forks = []upgrades.Fork{}
)

Expand Down
15 changes: 15 additions & 0 deletions app/upgrades/v6_4_5/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package v6_4_5

import (
"github.com/notional-labs/composable/v6/app/upgrades"
)

const (
// UpgradeName defines the on-chain upgrade name for the composable upgrade.
UpgradeName = "v6_4_5"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
}
27 changes: 27 additions & 0 deletions app/upgrades/v6_4_5/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package v6_4_5

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"
)

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) {
BrokenProposals := [3]uint64{2, 6, 11}
for _, proposal := range BrokenProposals {
keepers.GovKeeper.DeleteProposal(ctx, proposal)
}
return mm.RunMigrations(ctx, configurator, vm)
}
}
4 changes: 2 additions & 2 deletions tests/interchaintest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package interchaintest

import (
"os"
"strings"

"github.com/strangelove-ventures/interchaintest/v7/ibc"
)
Expand Down Expand Up @@ -50,6 +49,7 @@ func GetDockerImageInfo() (repo, version string) {
}

// github converts / to - for pushed docker images
branchVersion = strings.ReplaceAll(branchVersion, "/", "-")
// branchVersion = strings.ReplaceAll(branchVersion, "/", "-")
branchVersion = "latest"
return repo, branchVersion
}
4 changes: 2 additions & 2 deletions tests/interchaintest/upgrade_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (

func TestCentauriUpgrade(t *testing.T) {
repo, version := GetDockerImageInfo()
CosmosChainUpgradeTest(t, repo, version, "v6_4")
CosmosChainUpgradeTest(t, repo, version, "v6_4_5")
}

func CosmosChainUpgradeTest(t *testing.T, upgradeContainerRepo, upgradeVersion, upgradeName string) {
Expand All @@ -39,7 +39,7 @@ func CosmosChainUpgradeTest(t *testing.T, upgradeContainerRepo, upgradeVersion,
Images: []ibc.DockerImage{
{
Repository: "ghcr.io/composablefi/composable-cosmos",
Version: "6.3.7",
Version: "6.4.4",
UidGid: "1025:1025",
},
},
Expand Down

0 comments on commit 6a87f21

Please sign in to comment.