Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove wasm folder migration #2181

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ import (
"github.com/axelarnetwork/axelar-core/x/vote"
voteKeeper "github.com/axelarnetwork/axelar-core/x/vote/keeper"
voteTypes "github.com/axelarnetwork/axelar-core/x/vote/types"
"github.com/axelarnetwork/utils/funcs"

// Override with generated statik docs
_ "github.com/axelarnetwork/axelar-core/client/docs/statik"
Expand Down Expand Up @@ -267,11 +266,6 @@ func NewAxelarApp(
panic(fmt.Sprintf("failed to resolve absolute path for new wasm dir %s: %v", wasmDir, err))
}

// Migrate wasm dir from old path to new path
// TODO: Remove this once nodes have migrated
oldWasmDir := filepath.Join(homePath, "wasm")
funcs.MustNoErr(migrateWasmDir(oldWasmDir, wasmPath))

SetKeeper(keepers, initWasmKeeper(encodingConfig, keys, keepers, bApp, appOpts, wasmOpts, wasmPath))
SetKeeper(keepers, initWasmContractKeeper(keepers))

Expand Down Expand Up @@ -465,25 +459,6 @@ func initMessageRouter(keepers *KeeperCache) nexusTypes.MessageRouter {
return messageRouter
}

func migrateWasmDir(oldWasmDir, newWasmDir string) error {
// If the new wasm dir exists, there's nothing to do
if _, err := os.Stat(newWasmDir); err == nil {
return nil
}

// If the old wasm dir doesn't exist, there's nothing to do
if _, err := os.Stat(oldWasmDir); err != nil && os.IsNotExist(err) {
return nil
}

// Move the wasm dir from old path to new path
if err := os.Rename(oldWasmDir, newWasmDir); err != nil {
return fmt.Errorf("failed to move wasm directory from %s to %s: %v", oldWasmDir, newWasmDir, err)
}

return nil
}

func (app *AxelarApp) registerWasmSnapshotExtension(keepers *KeeperCache) {
// Register wasm snapshot extension to enable state-sync compatibility for wasm.
// MUST be done before loading the version
Expand Down
Loading