Skip to content

Commit 141d74d

Browse files
authored
fix(cmd/testnetify): pass config by pointer (#2018)
Signed-off-by: Artur Troian <[email protected]> Co-authored-by: Artur Troian <[email protected]>
1 parent eba5456 commit 141d74d

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

app/testnet.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,16 @@ type TestnetConfig struct {
6969
func InitAkashAppForTestnet(
7070
app *AkashApp,
7171
db dbm.DB,
72-
tcfg TestnetConfig,
72+
tcfg *TestnetConfig,
7373
) *AkashApp {
7474
//
7575
// Required Changes:
7676
//
7777

78+
if tcfg == nil {
79+
tmos.Exit("TestnetConfig cannot be nil")
80+
}
81+
7882
var err error
7983

8084
defer func() {

cmd/akash/cmd/app_creator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ func (a appCreator) newTestnetApp(logger log.Logger, db dbm.DB, traceStore io.Wr
150150
panic("app created from newApp is not of type AkashApp")
151151
}
152152

153-
tcfg, valid := appOpts.Get(cflags.KeyTestnetConfig).(akash.TestnetConfig)
153+
tcfg, valid := appOpts.Get(cflags.KeyTestnetConfig).(*akash.TestnetConfig)
154154
if !valid {
155-
panic("cflags.KeyTestnetConfig is not of type akash.TestnetConfig")
155+
panic("cflags.KeyTestnetConfig is not of type *akash.TestnetConfig")
156156
}
157157

158158
// Make modifications to the normal AkashApp required to run the network locally

script/upgrades.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,10 @@ trap_show() {
169169
}
170170

171171
function cleanup() {
172-
jb=$(jobs -p)
173-
174-
if [[ "$jb" != "" ]]; then
172+
while IFS= read -r pid; do
175173
# shellcheck disable=SC2086
176-
kill $jb
177-
fi
174+
kill $pid
175+
done < <(jobs -p)
178176
}
179177

180178
trap_add EXIT 'cleanup'
@@ -365,7 +363,7 @@ function init() {
365363
genesis_file=${valdir}/config/genesis.json
366364
rm -f "$genesis_file"
367365

368-
$AKASH init --home "$valdir" "$(jq -rc '.moniker' <<<"$val")" >/dev/null 2>&1
366+
$AKASH genesis init --home "$valdir" "$(jq -rc '.moniker' <<<"$val")" >/dev/null 2>&1
369367

370368
cat >"$valdir/.envrc" <<EOL
371369
PATH_add "\$(pwd)/cosmovisor/current/bin"

0 commit comments

Comments
 (0)