Skip to content

Commit da4f325

Browse files
committed
fix node home issue
1 parent da7cac5 commit da4f325

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

app/app_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
2626

2727
"cosmossdk.io/x/upgrade"
28-
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
2928
"github.com/cosmos/cosmos-sdk/x/bank"
3029

3130
ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
@@ -67,7 +66,7 @@ func TestInitGenesisOnMigration(t *testing.T) {
6766
db := dbm.NewMemDB()
6867
logger := log.NewLogger(os.Stdout)
6968
app := NewMinitiaApp(
70-
logger, db, nil, true, []wasmkeeper.Option{}, simtestutil.EmptyAppOptions{})
69+
logger, db, nil, true, []wasmkeeper.Option{}, EmptyAppOptions{})
7170
ctx := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()})
7271

7372
// Create a mock module. This module will serve as the new module we're
@@ -122,7 +121,7 @@ func TestGetKey(t *testing.T) {
122121
db := dbm.NewMemDB()
123122
app := NewMinitiaApp(
124123
log.NewLogger(os.Stdout),
125-
db, nil, true, []wasmkeeper.Option{}, simtestutil.EmptyAppOptions{})
124+
db, nil, true, []wasmkeeper.Option{}, EmptyAppOptions{})
126125

127126
require.NotEmpty(t, app.GetKey(banktypes.StoreKey))
128127
require.NotEmpty(t, app.GetMemKey(capabilitytypes.MemStoreKey))

app/encoding.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"cosmossdk.io/core/appmodule"
66
"cosmossdk.io/log"
77
dbm "github.com/cosmos/cosmos-db"
8+
"github.com/cosmos/cosmos-sdk/client/flags"
89
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
9-
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
1010
sdk "github.com/cosmos/cosmos-sdk/types"
1111
"github.com/cosmos/cosmos-sdk/types/module"
1212
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
@@ -18,7 +18,7 @@ import (
1818

1919
// MakeEncodingConfig creates an EncodingConfig for testing
2020
func MakeEncodingConfig() params.EncodingConfig {
21-
tempApp := NewMinitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, []wasmkeeper.Option{}, simtestutil.EmptyAppOptions{})
21+
tempApp := NewMinitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, []wasmkeeper.Option{}, EmptyAppOptions{})
2222
encodingConfig := params.EncodingConfig{
2323
InterfaceRegistry: tempApp.InterfaceRegistry(),
2424
Codec: tempApp.AppCodec(),
@@ -30,7 +30,7 @@ func MakeEncodingConfig() params.EncodingConfig {
3030
}
3131

3232
func AutoCliOpts() autocli.AppOptions {
33-
tempApp := NewMinitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, []wasmkeeper.Option{}, simtestutil.EmptyAppOptions{})
33+
tempApp := NewMinitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, []wasmkeeper.Option{}, EmptyAppOptions{})
3434
modules := make(map[string]appmodule.AppModule, 0)
3535
for _, m := range tempApp.ModuleManager.Modules {
3636
if moduleWithName, ok := m.(module.HasName); ok {
@@ -51,6 +51,18 @@ func AutoCliOpts() autocli.AppOptions {
5151
}
5252

5353
func BasicManager() module.BasicManager {
54-
tempApp := NewMinitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, []wasmkeeper.Option{}, simtestutil.EmptyAppOptions{})
54+
tempApp := NewMinitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, []wasmkeeper.Option{}, EmptyAppOptions{})
5555
return tempApp.BasicModuleManager
5656
}
57+
58+
// EmptyAppOptions is a stub implementing AppOptions
59+
type EmptyAppOptions struct{}
60+
61+
// Get implements AppOptions
62+
func (ao EmptyAppOptions) Get(o string) interface{} {
63+
if o == flags.FlagHome {
64+
return DefaultNodeHome
65+
}
66+
67+
return nil
68+
}

app/test_helpers.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
1717
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
1818
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
19-
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
2019
sdk "github.com/cosmos/cosmos-sdk/types"
2120
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
2221
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
@@ -61,7 +60,7 @@ func setup(db *dbm.DB, withGenesis bool) (*MinitiaApp, GenesisState) {
6160
nil,
6261
true,
6362
[]wasmkeeper.Option{},
64-
simtestutil.EmptyAppOptions{},
63+
EmptyAppOptions{},
6564
)
6665

6766
if withGenesis {

0 commit comments

Comments
 (0)