Skip to content

Commit cb5efd0

Browse files
committed
feat: prepare v12.0.0-alpha.2
1 parent 83e8574 commit cb5efd0

4 files changed

Lines changed: 85 additions & 0 deletions

File tree

app.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import (
4848
"github.com/noble-assets/noble/v12/api"
4949
"github.com/noble-assets/noble/v12/jester"
5050
"github.com/noble-assets/noble/v12/upgrade"
51+
"github.com/noble-assets/noble/v12/upgrade/v12alpha2"
5152
"github.com/spf13/cast"
5253

5354
_ "cosmossdk.io/x/evidence"
@@ -478,6 +479,14 @@ func (app *App) RegisterUpgradeHandler() error {
478479
app.HyperlaneKeeper.IsmKeeper,
479480
),
480481
)
482+
app.UpgradeKeeper.SetUpgradeHandler(
483+
v12alpha2.UpgradeName,
484+
v12alpha2.CreateUpgradeHandler(
485+
app.ModuleManager,
486+
app.Configurator(),
487+
app.FTFKeeper,
488+
),
489+
)
481490

482491
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
483492
if err != nil {

app.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ modules:
3939
- account: dollar/yield
4040
- account: hyperlane
4141
- account: warp
42+
permissions: [ burner, minter ]
4243
authority: authority # Utilize our custom x/authority module.
4344
- name: authz
4445
config:

upgrade/v12alpha2/constants.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
//
3+
// Copyright 2025 NASD Inc. All Rights Reserved.
4+
//
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
package v12alpha2
18+
19+
// UpgradeName is the name of this specific software upgrade used on-chain.
20+
const UpgradeName = "v12.0.0-alpha.2"
21+
22+
// DevnetChainID is the Chain ID of the Noble devnet.
23+
const DevnetChainID = "duke-1"

upgrade/v12alpha2/upgrade.go

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
//
3+
// Copyright 2025 NASD Inc. All Rights Reserved.
4+
//
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
package v12alpha2
18+
19+
import (
20+
"context"
21+
"fmt"
22+
23+
upgradetypes "cosmossdk.io/x/upgrade/types"
24+
ftfkeeper "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/keeper"
25+
ftftypes "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/types"
26+
sdk "github.com/cosmos/cosmos-sdk/types"
27+
"github.com/cosmos/cosmos-sdk/types/module"
28+
)
29+
30+
func CreateUpgradeHandler(
31+
mm *module.Manager,
32+
cfg module.Configurator,
33+
ftfKeeper *ftfkeeper.Keeper,
34+
) upgradetypes.UpgradeHandler {
35+
return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
36+
chainID := sdk.UnwrapSDKContext(ctx).ChainID()
37+
if chainID != DevnetChainID {
38+
return vm, fmt.Errorf("%s upgrade not allowed to execute on %s chain", UpgradeName, chainID)
39+
}
40+
41+
vm, err := mm.RunMigrations(ctx, cfg, vm)
42+
if err != nil {
43+
return vm, err
44+
}
45+
46+
// Because the paused store was not intialized in the devnet genesis,
47+
// it must be configured here for USDC transfers to be successful.
48+
ftfKeeper.SetPaused(ctx, ftftypes.Paused{Paused: false})
49+
50+
return vm, nil
51+
}
52+
}

0 commit comments

Comments
 (0)