Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-bash-to-docker-image
Browse files Browse the repository at this point in the history
  • Loading branch information
talalashraf authored Sep 24, 2024
2 parents 528c812 + b81c103 commit d78f510
Showing 1 changed file with 0 additions and 25 deletions.
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

0 comments on commit d78f510

Please sign in to comment.