Skip to content

Commit

Permalink
wip: fix errors in testutil/network
Browse files Browse the repository at this point in the history
  • Loading branch information
Lockwarr committed Dec 22, 2023
1 parent 770191b commit ff98450
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types"
"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/stretchr/testify/require"

"github.com/Nolus-Protocol/nolus-core/app"
"github.com/Nolus-Protocol/nolus-core/app/params"
Expand All @@ -39,7 +40,8 @@ func New(t *testing.T, configs ...network.Config) *network.Network {
cfg = configs[0]
}
params.SetAddressPrefixes()
net := network.New(t, cfg)
net, err := network.New(t, t.TempDir(), cfg)
require.NoError(t, err)
t.Cleanup(net.Cleanup)
return net
}
Expand All @@ -54,13 +56,13 @@ func DefaultConfig() network.Config {
LegacyAmino: encoding.Amino,
InterfaceRegistry: encoding.InterfaceRegistry,
AccountRetriever: authtypes.AccountRetriever{},
AppConstructor: func(val network.Validator) servertypes.Application {
AppConstructor: func(val network.ValidatorI) servertypes.Application {
return app.New(
val.Ctx.Logger, tmdb.NewMemDB(), nil, true, map[int64]bool{}, val.Ctx.Config.RootDir, 0,
val.GetCtx().Logger, tmdb.NewMemDB(), nil, true, map[int64]bool{}, val.GetCtx().Config.RootDir, 0,
encoding,
sims.EmptyAppOptions{},
baseapp.SetPruning(storetypes.NewPruningOptionsFromString(val.AppConfig.Pruning)),
baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices),
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)),
baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices),
)
},
GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Marshaler),
Expand All @@ -73,7 +75,7 @@ func DefaultConfig() network.Config {
StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction),
BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction),

PruningStrategy: storetypes.PruningOptionNothing,
PruningStrategy: pruningtypes.PruningOptionNothing,
CleanupDir: true,
SigningAlgo: string(hd.Secp256k1Type),
KeyringOptions: []keyring.Option{},
Expand Down

0 comments on commit ff98450

Please sign in to comment.