Skip to content

Commit

Permalink
feat: v8.0.0-rc.4 upgrade handler (#422)
Browse files Browse the repository at this point in the history
Co-authored-by: John Letey <[email protected]>
  • Loading branch information
boojamya and johnletey authored Nov 6, 2024
1 parent f5dc67c commit dd84043
Show file tree
Hide file tree
Showing 22 changed files with 1,683 additions and 222 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ifeq (,$(shell which heighliner))
@echo heighliner not found. https://github.com/strangelove-ventures/heighliner
else
@echo "🤖 Building image..."
@heighliner build --chain noble --local 1> /dev/null
@heighliner build --chain noble --local
@echo "✅ Completed build!"
endif

Expand Down
27 changes: 11 additions & 16 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ import (
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
"github.com/noble-assets/noble/v8/upgrade"
"github.com/noble-assets/noble/v8/upgrade/testnet"

_ "cosmossdk.io/x/evidence"
_ "cosmossdk.io/x/feegrant/module"
Expand Down Expand Up @@ -73,21 +72,27 @@ import (
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"

// IBC Modules
pfmkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
transferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"

// Circle Modules
cctpkeeper "github.com/circlefin/noble-cctp/x/cctp/keeper"
ftfkeeper "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/keeper"

// Ondo Modules
aurakeeper "github.com/ondoprotocol/usdy-noble/v2/keeper"

// Hashnote Modules
halokeeper "github.com/noble-assets/halo/v2/keeper"

// Monerium Modules
florinkeeper "github.com/monerium/module-noble/v2/keeper"

// Noble Modules
authoritykeeper "github.com/noble-assets/authority/keeper"
forwardingkeeper "github.com/noble-assets/forwarding/v2/keeper"
Expand Down Expand Up @@ -295,23 +300,13 @@ func (app *App) GetSubspace(moduleName string) paramstypes.Subspace {

func (app *App) RegisterUpgradeHandler() error {
app.UpgradeKeeper.SetUpgradeHandler(
upgrade.UpgradeName,
upgrade.CreateUpgradeHandler(
testnet.UpgradeName,
testnet.CreateUpgradeHandler(
app.ModuleManager,
app.Configurator(),
app.appCodec,
app.interfaceRegistry,
app.Logger(),
app.GetKey(capabilitytypes.StoreKey),
app.AccountKeeper,
app.AuthorityKeeper,
app.BankKeeper,
app.CapabilityKeeper,
app.IBCKeeper.ClientKeeper,
app.ConsensusKeeper,
app.GlobalFeeKeeper,
app.ParamsKeeper,
app.StakingKeeper,
),
)

Expand All @@ -323,8 +318,8 @@ func (app *App) RegisterUpgradeHandler() error {
return nil
}

if upgradeInfo.Name == upgrade.UpgradeName {
app.SetStoreLoader(upgrade.CreateStoreLoader(upgradeInfo.Height))
if upgradeInfo.Name == testnet.UpgradeName {
app.SetStoreLoader(testnet.CreateStoreLoader(upgradeInfo.Height))
}

return nil
Expand Down
14 changes: 14 additions & 0 deletions cmd/init.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2024 NASD Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cmd

import (
Expand Down
14 changes: 14 additions & 0 deletions cmd/nobled/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2024 NASD Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
Expand Down
2 changes: 1 addition & 1 deletion e2e/cctp_deposit_for_burn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestCCTP_DepositForBurn(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand Down
2 changes: 1 addition & 1 deletion e2e/cctp_deposit_for_burn_with_caller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestCCTP_DepositForBurnWithCaller(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand Down
2 changes: 1 addition & 1 deletion e2e/cctp_receive_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestCCTP_ReceiveMessage(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand Down
2 changes: 1 addition & 1 deletion e2e/cctp_receive_message_with_caller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestCCTP_ReceiveMessageWithCaller(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand Down
2 changes: 1 addition & 1 deletion e2e/cctp_replace_deposit_for_burn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestCCTP_ReplaceDepositForBurn(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand Down
8 changes: 4 additions & 4 deletions e2e/cctp_roles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestCCTP_UpdateOwner(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand Down Expand Up @@ -67,7 +67,7 @@ func TestCCTP_UpdateAttesterManager(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand All @@ -91,7 +91,7 @@ func TestCCTP_UpdatePauser(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand All @@ -115,7 +115,7 @@ func TestCCTP_UpdateTokenController(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
nobleValidator := noble.Validators[0]

Expand Down
2 changes: 1 addition & 1 deletion e2e/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestConformance(t *testing.T) {
ctx := context.Background()

var nw e2e.NobleWrapper
nw, ibcSimd, rf, r, ibcPathName, rep, _, client, network := e2e.NobleSpinUpIBC(t, ctx, false)
nw, ibcSimd, rf, r, ibcPathName, rep, _, client, network := e2e.NobleSpinUpIBC(t, ctx, e2e.LocalImages, false)

conformance.TestChainPair(t, ctx, client, network, nw.Chain, ibcSimd, rf, rep, r, ibcPathName)
}
42 changes: 21 additions & 21 deletions e2e/fiat_tf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestFiatTFUpdateOwner(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -89,7 +89,7 @@ func TestFiatTFAcceptOwner(t *testing.T) {
t.Parallel()

ctx := context.Background()
nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -201,7 +201,7 @@ func TestFiatTFUpdateMasterMinter(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -316,7 +316,7 @@ func TestFiatTFConfigureMinterController(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -530,7 +530,7 @@ func TestFiatTFRemoveMinterController(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -625,7 +625,7 @@ func TestFiatTFConfigureMinter(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -716,7 +716,7 @@ func TestFiatTFRemoveMinter(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -799,7 +799,7 @@ func TestFiatTFUpdatePauser(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -913,7 +913,7 @@ func TestFiatTFPause(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -971,7 +971,7 @@ func TestFiatTFUnpause(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1029,7 +1029,7 @@ func TestFiatTFUpdateBlacklister(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1143,7 +1143,7 @@ func TestFiatTFBlacklist(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1233,7 +1233,7 @@ func TestFiatTFUnblacklist(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1314,7 +1314,7 @@ func TestFiatTFMint(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1453,7 +1453,7 @@ func TestFiatTFBurn(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1547,7 +1547,7 @@ func TestFiatTFAuth(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1621,7 +1621,7 @@ func TestFiatTFAuthzGrant(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1674,7 +1674,7 @@ func TestFiatTFAuthzSend(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1791,7 +1791,7 @@ func TestFiatTFBankSend(t *testing.T) {

ctx := context.Background()

nw := e2e.NobleSpinUp(t, ctx, true)
nw, _ := e2e.NobleSpinUp(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1869,7 +1869,7 @@ func TestFiatTFIBCOut(t *testing.T) {

ctx := context.Background()

nw, gaia, _, r, ibcPathName, _, eRep, _, _ := e2e.NobleSpinUpIBC(t, ctx, true)
nw, gaia, _, r, ibcPathName, _, eRep, _, _ := e2e.NobleSpinUpIBC(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down Expand Up @@ -1982,7 +1982,7 @@ func TestFiatTFIBCIn(t *testing.T) {

ctx := context.Background()

nw, gaia, _, r, ibcPathName, _, eRep, _, _ := e2e.NobleSpinUpIBC(t, ctx, true)
nw, gaia, _, r, ibcPathName, _, eRep, _, _ := e2e.NobleSpinUpIBC(t, ctx, e2e.LocalImages, true)
noble := nw.Chain
val := noble.Validators[0]

Expand Down
Loading

0 comments on commit dd84043

Please sign in to comment.