-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add no-op v6.0.0_testnet_fix upgrade for testnet
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package v_6_0_0_testnet_fix | ||
|
||
import ( | ||
store "cosmossdk.io/store/types" | ||
|
||
"github.com/dydxprotocol/v4-chain/protocol/app/upgrades" | ||
) | ||
|
||
const ( | ||
// v6_0_0_testnet_fix not intended for prod use. | ||
UpgradeName = "v6.0.0_testnet_fix" | ||
) | ||
|
||
var ( | ||
Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
StoreUpgrades: store.StoreUpgrades{}, | ||
} | ||
) |
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,21 @@ | ||
package v_6_0_0_testnet_fix | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
"github.com/dydxprotocol/v4-chain/protocol/lib" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
sdkCtx := lib.UnwrapSDKContext(ctx, "app/upgrades") | ||
sdkCtx.Logger().Info(fmt.Sprintf("Running %s Upgrade...", UpgradeName)) | ||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |