Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resovle and ignore few lint errors #336

Merged
merged 1 commit into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x/asset/client/cli/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func parseAssetMappingFlags(fs *pflag.FlagSet) (*createAddAssetMappingInputs, er
return nil, fmt.Errorf("must pass in add asset mapping json using the --%s flag", FlagAddAssetMappingFile)
}

contents, err := ioutil.ReadFile(addAssetMappingFile)
contents, err := ioutil.ReadFile(addAssetMappingFile) //nolint:gosec
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions x/lend/client/cli/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func parseAddNewLendPairsFlags(fs *pflag.FlagSet) (*addNewLendPairsInputs, error
return nil, fmt.Errorf("must pass in a add new lend pairs json using the --%s flag", FlagNewLendPairFile)
}

contents, err := ioutil.ReadFile(addLendPairsParamsFile)
contents, err := ioutil.ReadFile(addLendPairsParamsFile) //nolint:gosec
if err != nil {
return nil, err
}
Expand All @@ -97,7 +97,7 @@ func parseAddPoolFlags(fs *pflag.FlagSet) (*addLendPoolInputs, error) {
return nil, fmt.Errorf("must pass in a add new pool json using the --%s flag", FlagAddLendPoolFile)
}

contents, err := ioutil.ReadFile(addPoolParamsParamsFile)
contents, err := ioutil.ReadFile(addPoolParamsParamsFile) //nolint:gosec
if err != nil {
return nil, err
}
Expand All @@ -119,7 +119,7 @@ func parseAssetRateStatsFlags(fs *pflag.FlagSet) (*addAssetRatesStatsInputs, err
return nil, fmt.Errorf("must pass in a add asset rates stats json using the --%s flag", FlagAddAssetRatesStatsFile)
}

contents, err := ioutil.ReadFile(addAssetRatesStatsFile)
contents, err := ioutil.ReadFile(addAssetRatesStatsFile) //nolint:gosec
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x/liquidity/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
TypeMsgCancelOrder = "cancel_order"
TypeMsgCancelAllOrders = "cancel_all_orders"
TypeMsgTokensSoftLock = "tokens_soft_lock"
TypeMsgTokensSoftUnlock = "tokens_soft_unlock"
TypeMsgTokensSoftUnlock = "tokens_soft_unlock" //nolint:gosec
)

// NewMsgCreatePair returns a new MsgCreatePair.
Expand Down
11 changes: 7 additions & 4 deletions x/vault/client/testutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ func MsgCreate(
if err != nil {
return resp, err
}
var respJson map[string]interface{}
json.Unmarshal([]byte(resp.String()), &respJson)
if respJson["code"] != 0 {
errLog, _ := respJson["raw_log"].(string)
var respJSON map[string]interface{}
err = json.Unmarshal([]byte(resp.String()), &respJSON)
if err != nil {
return nil, err
}
if respJSON["code"] != 0 {
errLog, _ := respJSON["raw_log"].(string)
err = fmt.Errorf(errLog)
}
return resp, err
Expand Down