Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed May 8, 2024
1 parent 6c9992d commit f63a54e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/context/server_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ServerContext interface {
GetLogger() log.Logger
GetViper() *viper.Viper
GetConfig() CometConfig
SetRoot(rootDir string)
}

type BaseConfig interface {
Expand Down
3 changes: 3 additions & 0 deletions simapp/simd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ func initTestnetFiles(
return err
}

// Update viper root since root dir become rootdir/node/simd
corectx.GetServerContextFromCmd(cmd).SetRoot(nodeConfig.RootDir)

cmd.PrintErrf("Successfully initialized %d node directories\n", args.numValidators)
return nil
}
Expand Down
3 changes: 2 additions & 1 deletion simapp/simd/cmd/testnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"cosmossdk.io/x/auth"
banktypes "cosmossdk.io/x/bank/types"
"cosmossdk.io/x/staking"
corectx "cosmossdk.io/core/context"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down Expand Up @@ -75,7 +76,7 @@ func Test_TestnetCmd(t *testing.T) {
err = cmd.ExecuteContext(ctx)
require.NoError(t, err)

genFile := cfg.GenesisFile()
genFile := corectx.GetServerContextFromCmd(cmd).GetConfig().GenesisFile()
appState, _, err := genutiltypes.GenesisStateFromGenFile(genFile)
require.NoError(t, err)

Expand Down

0 comments on commit f63a54e

Please sign in to comment.