Skip to content

Commit

Permalink
test: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dudong2 committed Jan 17, 2024
1 parent 6d0df18 commit 9395e7d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
4 changes: 3 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ func (app *EthermintApp) RegisterUpgradeHandlers(
}

legacyBaseAppSubspace := paramsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())
baseapp.MigrateParams(sdkCtx, legacyBaseAppSubspace, &consensusParamsKeeper.ParamsStore)
if err := baseapp.MigrateParams(sdkCtx, legacyBaseAppSubspace, &consensusParamsKeeper.ParamsStore); err != nil {
return nil, err
}

// ibc v7.1
// explicitly update the IBC 02-client params, adding the localhost client type
Expand Down
28 changes: 22 additions & 6 deletions cmd/ethermintd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ import (
"github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdkserver "github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -62,8 +60,6 @@ func initRootCmd(
encodingConfig params.EncodingConfig,
rootCmd *cobra.Command,
txConfig client.TxConfig,
interfaceRegistry codectypes.InterfaceRegistry,
appCodec codec.Codec,
basicManager module.BasicManager,
) {
cfg := sdk.GetConfig()
Expand Down Expand Up @@ -266,13 +262,33 @@ func (a appCreator) appExport(
}

if height != -1 {
ethermintApp = ethermintapp.NewEthermintApp(logger, db, traceStore, false, map[int64]bool{}, "", uint(1), appOpts, baseapp.SetChainID(ethermintapp.ChainID))
ethermintApp = ethermintapp.NewEthermintApp(
logger,
db,
traceStore,
false,
map[int64]bool{},
"",
uint(1),
appOpts,
baseapp.SetChainID(ethermintapp.ChainID),
)

if err := ethermintApp.LoadHeight(height); err != nil {
return servertypes.ExportedApp{}, err
}
} else {
ethermintApp = ethermintapp.NewEthermintApp(logger, db, traceStore, true, map[int64]bool{}, "", uint(1), appOpts, baseapp.SetChainID(ethermintapp.ChainID))
ethermintApp = ethermintapp.NewEthermintApp(
logger,
db,
traceStore,
true,
map[int64]bool{},
"",
uint(1),
appOpts,
baseapp.SetChainID(ethermintapp.ChainID),
)
}

return ethermintApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ethermintd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
// TODO: double-check
// authclient.Codec = encodingConfig.Codec

initRootCmd(tempApp, encodingConfig, rootCmd, encodingConfig.TxConfig, encodingConfig.InterfaceRegistry, encodingConfig.Codec, tempApp.BasicModuleManager)
initRootCmd(tempApp, encodingConfig, rootCmd, encodingConfig.TxConfig, tempApp.BasicModuleManager)

autoCliOpts := tempApp.AutoCliOpts()
initClientCtx, _ = config.ReadFromClientConfig(initClientCtx)
Expand Down
5 changes: 4 additions & 1 deletion testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,10 @@ func (n *Network) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, err
// blocks has been reached.
func (n *Network) RetryForBlocks(retryFunc func() error, blocks int) error {
for i := 0; i < blocks; i++ {
n.WaitForNextBlock()
if err := n.WaitForNextBlock(); err != nil {
return err
}

err := retryFunc()
if err == nil {
return nil
Expand Down
11 changes: 9 additions & 2 deletions testutil/network/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,15 @@ func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error {
return err
}

appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig,
tmCfg, initCfg, appGenesis, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator, cfg.TxConfig.SigningContext().ValidatorAddressCodec())
appState, err := genutil.GenAppStateFromConfig(
cfg.Codec, cfg.TxConfig,
tmCfg,
initCfg,
appGenesis,
banktypes.GenesisBalancesIterator{},
genutiltypes.DefaultMessageValidator,
cfg.TxConfig.SigningContext().ValidatorAddressCodec(),
)
if err != nil {
return err
}
Expand Down

0 comments on commit 9395e7d

Please sign in to comment.