diff --git a/app/testnet.go b/app/testnet.go index c71b53b3e..0a4238b77 100644 --- a/app/testnet.go +++ b/app/testnet.go @@ -69,12 +69,16 @@ type TestnetConfig struct { func InitAkashAppForTestnet( app *AkashApp, db dbm.DB, - tcfg TestnetConfig, + tcfg *TestnetConfig, ) *AkashApp { // // Required Changes: // + if tcfg == nil { + tmos.Exit("TestnetConfig cannot be nil") + } + var err error defer func() { diff --git a/cmd/akash/cmd/app_creator.go b/cmd/akash/cmd/app_creator.go index 4d3abcadd..8a8f923be 100644 --- a/cmd/akash/cmd/app_creator.go +++ b/cmd/akash/cmd/app_creator.go @@ -150,9 +150,9 @@ func (a appCreator) newTestnetApp(logger log.Logger, db dbm.DB, traceStore io.Wr panic("app created from newApp is not of type AkashApp") } - tcfg, valid := appOpts.Get(cflags.KeyTestnetConfig).(akash.TestnetConfig) + tcfg, valid := appOpts.Get(cflags.KeyTestnetConfig).(*akash.TestnetConfig) if !valid { - panic("cflags.KeyTestnetConfig is not of type akash.TestnetConfig") + panic("cflags.KeyTestnetConfig is not of type *akash.TestnetConfig") } // Make modifications to the normal AkashApp required to run the network locally diff --git a/script/upgrades.sh b/script/upgrades.sh index 1a36983ba..97f209d60 100755 --- a/script/upgrades.sh +++ b/script/upgrades.sh @@ -169,12 +169,10 @@ trap_show() { } function cleanup() { - jb=$(jobs -p) - - if [[ "$jb" != "" ]]; then + while IFS= read -r pid; do # shellcheck disable=SC2086 - kill $jb - fi + kill $pid + done < <(jobs -p) } trap_add EXIT 'cleanup' @@ -365,7 +363,7 @@ function init() { genesis_file=${valdir}/config/genesis.json rm -f "$genesis_file" - $AKASH init --home "$valdir" "$(jq -rc '.moniker' <<<"$val")" >/dev/null 2>&1 + $AKASH genesis init --home "$valdir" "$(jq -rc '.moniker' <<<"$val")" >/dev/null 2>&1 cat >"$valdir/.envrc" <