Skip to content

Commit

Permalink
feat(uniond): upgrade migration to v0.13.0 (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
cor authored Sep 21, 2023
2 parents b762c7f + 6f385d1 commit 78fc7cd
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
spell-fmt-check:
uses: unionlabs/workflows/.github/workflows/build.yml@93f1339fbc51f0c2cfca29d7c365c56816f42262
uses: unionlabs/workflows/.github/workflows/build.yml@6eccb283a2aa25534832e751402e50b7a3ec3f9c
secrets:
nixbuild_token: ${{ secrets.nixbuild_token }}
access-tokens: github.com=${{ secrets.GITHUB_TOKEN }}
Expand All @@ -41,7 +41,7 @@ jobs:
if: |
!cancelled()
&& (contains(needs.*.result, 'success') || github.event.pull_request.draft == true)
uses: unionlabs/workflows/.github/workflows/build.yml@2c94f6f3acb2d7d9222f8fa05f43eb8c3ed2e758
uses: unionlabs/workflows/.github/workflows/build.yml@6eccb283a2aa25534832e751402e50b7a3ec3f9c
secrets:
nixbuild_token: ${{ secrets.nixbuild_token }}
access-tokens: github.com=${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
if: |
!cancelled()
&& contains(needs.*.result, 'success')
uses: unionlabs/workflows/.github/workflows/build.yml@2c94f6f3acb2d7d9222f8fa05f43eb8c3ed2e758
uses: unionlabs/workflows/.github/workflows/build.yml@6eccb283a2aa25534832e751402e50b7a3ec3f9c
secrets:
nixbuild_token: ${{ secrets.nixbuild_token }}
access-tokens: github.com=${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
build:
uses: unionlabs/workflows/.github/workflows/build.yml@93f1339fbc51f0c2cfca29d7c365c56816f42262
uses: unionlabs/workflows/.github/workflows/build.yml@6eccb283a2aa25534832e751402e50b7a3ec3f9c
secrets:
nixbuild_token: ${{ secrets.nixbuild_token }}
access-tokens: github.com=${{ secrets.github-token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
uses: unionlabs/workflows/.github/workflows/build.yml@93f1339fbc51f0c2cfca29d7c365c56816f42262
uses: unionlabs/workflows/.github/workflows/build.yml@6eccb283a2aa25534832e751402e50b7a3ec3f9c
secrets:
nixbuild_token: ${{ secrets.nixbuild_token }}
access-tokens: github.com=${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions e2e/upgrades.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ in
${upgradeTo "v0.10.0" 20}
${upgradeTo "v0.11.0" 30}
${upgradeTo "v0.12.0" 40}
${upgradeTo "v0.13.0" 50}
'';

nodes = {
Expand Down
3 changes: 2 additions & 1 deletion uniond/app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"union/app/upgrades/v0_10_0"
"union/app/upgrades/v0_11_0"
"union/app/upgrades/v0_12_0"
"union/app/upgrades/v0_13_0"
"union/app/upgrades/v0_9_0"

upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

var Upgrades = []upgrades.Upgrade{v0_9_0.Upgrade, v0_10_0.Upgrade, v0_11_0.Upgrade, v0_12_0.Upgrade}
var Upgrades = []upgrades.Upgrade{v0_9_0.Upgrade, v0_10_0.Upgrade, v0_11_0.Upgrade, v0_12_0.Upgrade, v0_13_0.Upgrade}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
func (app *UnionApp) setupUpgradeStoreLoaders() {
Expand Down
14 changes: 14 additions & 0 deletions uniond/app/upgrades/v0_13_0/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package v0_13_0

import (
store "github.com/cosmos/cosmos-sdk/store/types"
"union/app/upgrades"
)

const UpgradeName = "v0.13.0"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{Added: []string{}},
}
15 changes: 15 additions & 0 deletions uniond/app/upgrades/v0_13_0/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package v0_13_0

import (
"union/app/upgrades"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateUpgradeHandler(mm *module.Manager, configurator module.Configurator, keepers *upgrades.AppKeepers) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, configurator, vm)
}
}
2 changes: 1 addition & 1 deletion unionvisor/unionvisor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
fallback_version = "v0.8.0";
};
bundle-testnet-next =
mkNextBundle "testnet" [ "v0.8.0" "v0.9.0" "v0.10.0" "v0.11.0" ] "v0.12.0" {
mkNextBundle "testnet" [ "v0.8.0" "v0.9.0" "v0.10.0" "v0.11.0" "v0.12.0" ] "v0.13.0" {
binary_name = "uniond";
versions_directory = "versions";
fallback_version = "v0.8.0";
Expand Down

0 comments on commit 78fc7cd

Please sign in to comment.