Skip to content

Commit

Permalink
replace if else with switch
Browse files Browse the repository at this point in the history
  • Loading branch information
dheerajkd30 committed May 9, 2023
1 parent 3cb30f0 commit bba2d4e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ linters:
- ineffassign
- misspell
- revive
- nakedret
#- nakedret
- nolintlint
- rowserrcheck
- staticcheck
Expand Down
8 changes: 5 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ import (

cwasm "github.com/comdex-official/comdex/app/wasm"

tv11 "github.com/comdex-official/comdex/app/upgrades/testnet/v11"
mv11 "github.com/comdex-official/comdex/app/upgrades/mainnet/v11"
tv11 "github.com/comdex-official/comdex/app/upgrades/testnet/v11"
)

const (
Expand Down Expand Up @@ -1350,12 +1350,14 @@ func (a *App) registerUpgradeHandlers() {
if err != nil {
panic(err)
}
if upgradeInfo.Name == tv11.UpgradeName {

switch {
case upgradeInfo.Name == tv11.UpgradeName:
a.UpgradeKeeper.SetUpgradeHandler(
tv11.UpgradeName,
tv11.CreateUpgradeHandlerV11(a.mm, a.configurator),
)
} else if upgradeInfo.Name == mv11.UpgradeName {
case upgradeInfo.Name == mv11.UpgradeName:
a.UpgradeKeeper.SetUpgradeHandler(
mv11.UpgradeName,
mv11.CreateUpgradeHandlerV11(a.mm, a.configurator, a.LiquidityKeeper, a.AssetKeeper, a.BankKeeper, a.AccountKeeper, a.Rewardskeeper, a.ICAHostKeeper),
Expand Down
1 change: 0 additions & 1 deletion app/upgrades/testnet/v10/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ func CreateUpgradeHandlerV10(
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
vm, err := mm.RunMigrations(ctx, configurator, fromVM)

if err != nil {
return vm, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/comdex/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func initRootCmd(rootCmd *cobra.Command, encoding comdex.EncodingConfig) {
genutilcli.GenTxCmd(comdex.ModuleBasics, encoding.TxConfig, banktypes.GenesisBalancesIterator{}, comdex.DefaultNodeHome),
genutilcli.ValidateGenesisCmd(comdex.ModuleBasics),
AddGenesisAccountCmd(comdex.DefaultNodeHome),
//AddGenesisWasmMsgCmd(comdex.DefaultNodeHome),
// AddGenesisWasmMsgCmd(comdex.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
testnetCmd(comdex.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(),
Expand Down
2 changes: 1 addition & 1 deletion x/asset/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ func NewCreateMultipleAssetsPairs(clientCtx client.Context, txf tx.Factory, fs *
if !ok {
return txf, nil, types.ErrorInvalidDecimals
}
newAssetOut, ok := sdk.NewIntFromString(assetOut[i])
newAssetOut, _ := sdk.NewIntFromString(assetOut[i])

assets = append(assets, types.AssetPair{
Name: names[i],
Expand Down

0 comments on commit bba2d4e

Please sign in to comment.