Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code committed Oct 28, 2023
1 parent ccebc85 commit 924acd9
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ lint:
echo "--> Running linter"
$(MAKE) lint-install
$(golangci_lint_cmd) run --build-tags=$(GO_BUILD) --fix --out-format=tab
@if [ $$(find . -name '*.go' -type f | xargs grep 'nolint' | wc -l) -ne 32 ]; then \
@if [ $$(find . -name '*.go' -type f | xargs grep 'nolint\|#nosec' | wc -l) -ne 41 ]; then \
echo "--> increase or decrease nolint, please recheck them"; \
echo "--> list nolint: \`find . -name '*.go' -type f | xargs grep 'nolint'\`"; exit 1;\
echo "--> list nolint: \`find . -name '*.go' -type f | xargs grep 'nolint\|#nosec'\`"; exit 1;\
fi

format: lint
Expand Down
4 changes: 2 additions & 2 deletions server/config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package config
const (
// BypassMinFeeMsgTypesKey defines the configuration key for the
// BypassMinFeeMsgTypes value.
BypassMinFeeMsgTypesKey = "bypass-min-fee.msg-types" //nolint:gosec #nosec G101
BypassMinFeeMsgTypesKey = "bypass-min-fee.msg-types" // #nosec G101

BypassMinFeeMsgMaxGasUsageKey = "bypass-min-fee.msg-max-gas-usage" //nolint:gosec #nosec G101
BypassMinFeeMsgMaxGasUsageKey = "bypass-min-fee.msg-max-gas-usage" // #nosec G101
)

const (
Expand Down
4 changes: 2 additions & 2 deletions types/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
const (
MainnetChainId = "fxcore"
mainnetEvmChainID = 530
MainnetGenesisHash = "56629F685970FEC1E35521FC943ACE9AEB2C53448544A0560E4DD5799E1A5593"
MainnetGenesisHash = "56629F685970FEC1E35521FC943ACE9AEB2C53448544A0560E4DD5799E1A5593" //nolint:gosec
MainnetBlockHeightV2 = 5_713_000
MainnetBlockHeightV3 = 8_756_000
MainnetBlockHeightV4 = 10_477_500
Expand All @@ -24,7 +24,7 @@ const (
const (
TestnetChainId = "dhobyghaut"
testnetEvmChainID = 90001
TestnetGenesisHash = "06D0A9659E1EC5B0E57E8E2E5F1B1266094808BC9B4081E1A55011FEF4586ACE"
TestnetGenesisHash = "06D0A9659E1EC5B0E57E8E2E5F1B1266094808BC9B4081E1A55011FEF4586ACE" //nolint:gosec
TestnetBlockHeightV2 = 3_418_880
TestnetBlockHeightV3 = 6_578_000
TestnetBlockHeightV4 = 8_088_000
Expand Down
4 changes: 2 additions & 2 deletions x/crosschain/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ func (suite *CrossChainGrpcTestSuite) TestKeeper_BatchFees() {
{
name: "batch fee mul normal",
malleate: func() {
bridgeTokenList := make([]*types.BridgeToken, 0)
bridgeTokenList := make([]*types.BridgeToken, 2)

externalKey, _ := ethsecp256k1.GenerateKey()
externalAcc := common.BytesToAddress(externalKey.PubKey().Address())
Expand All @@ -629,7 +629,7 @@ func (suite *CrossChainGrpcTestSuite) TestKeeper_BatchFees() {
})
suite.Require().NoError(err)
denom := suite.Keeper().GetBridgeTokenDenom(suite.ctx, token)
bridgeTokenList = append(bridgeTokenList, denom)
bridgeTokenList[i] = denom
initBalances := sdkmath.NewIntFromUint64(1e18).Mul(sdkmath.NewInt(20000))
err = suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewCoin(denom.Denom, initBalances)))
suite.Require().NoError(err)
Expand Down
2 changes: 1 addition & 1 deletion x/crosschain/types/eth_signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestOracleSetConfirmSig(t *testing.T) {
correctSig = "e108a7776de6b87183b0690484a74daef44aa6daf907e91abaf7bbfa426ae7706b12e0bd44ef7b0634710d99c2d81087a2f39e075158212343a3b2948ecf33d01c"
invalidSig = "fffff7776de6b87183b0690484a74daef44aa6daf907e91abaf7bbfa426ae7706b12e0bd44ef7b0634710d99c2d81087a2f39e075158212343a3b2948ecf33d01c"
ethAddress = "0xc783df8a850f42e7F7e57013759C285caa701eB6"
hash = "88165860d955aee7dc3e83d9d1156a5864b708841965585d206dbef6e9e1a499"
hash = "88165860d955aee7dc3e83d9d1156a5864b708841965585d206dbef6e9e1a499" // #nosec G101
)

specs := map[string]struct {
Expand Down
8 changes: 4 additions & 4 deletions x/erc20/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ func (suite *KeeperTestSuite) TestToTargetDenom() {
aliases = append(aliases, fmt.Sprintf("%s%s", module, helpers.GenerateAddressByModule(module)))
}
base := helpers.NewRandDenom()
return aliases[0], base, append(aliases, ibcDenom), fxtypes.ParseFxTarget(fmt.Sprintf("ibc/%s/px", strings.TrimPrefix(channelID, ibcchanneltypes.ChannelPrefix))), ibcDenom
return aliases[0], base, append(aliases, ibcDenom), fxtypes.ParseFxTarget(fmt.Sprintf("ibc/%s/px", strings.TrimPrefix(channelID, ibcchanneltypes.ChannelPrefix))), ibcDenom // #nosec G602
},
},
{
Expand All @@ -651,7 +651,7 @@ func (suite *KeeperTestSuite) TestToTargetDenom() {
aliases = append(aliases, fmt.Sprintf("%s%s", module, helpers.GenerateAddressByModule(module)))
}
base := helpers.NewRandDenom()
return aliases[0], base, append(aliases, ibcDenom), fxtypes.ParseFxTarget(fmt.Sprintf("ibc/%s/px", strings.TrimPrefix(channelID, ibcchanneltypes.ChannelPrefix))), aliases[0]
return aliases[0], base, append(aliases, ibcDenom), fxtypes.ParseFxTarget(fmt.Sprintf("ibc/%s/px", strings.TrimPrefix(channelID, ibcchanneltypes.ChannelPrefix))), aliases[0] // #nosec G602
},
},
{
Expand All @@ -676,7 +676,7 @@ func (suite *KeeperTestSuite) TestToTargetDenom() {
i++
}
base := helpers.NewRandDenom()
return aliases[0], base, append(aliases, ibcDenom), fxtypes.ParseFxTarget(idxModule), idxDenom
return aliases[0], base, append(aliases, ibcDenom), fxtypes.ParseFxTarget(idxModule), idxDenom // #nosec G602
},
},
{
Expand All @@ -701,7 +701,7 @@ func (suite *KeeperTestSuite) TestToTargetDenom() {
i++
}
base := helpers.NewRandDenom()
return aliases[0], base, append(aliases, ibcDenom), fxtypes.ParseFxTarget(idxModule), aliases[0]
return aliases[0], base, append(aliases, ibcDenom), fxtypes.ParseFxTarget(idxModule), aliases[0] // #nosec G602
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion x/erc20/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const (
EventTypeConvertDenom = "convert_denom"
EventTypeRegisterCoin = "register_coin"
EventTypeRegisterERC20 = "register_erc20"
EventTypeToggleTokenRelay = "toggle_token_relay" //nolint:gosec #nosec G101
EventTypeToggleTokenRelay = "toggle_token_relay" // #nosec G101
EventTypeERC20Processing = "erc20_processing"
EventTypeRelayTransfer = "relay_transfer"
EventTypeRelayTransferCrossChain = "relay_transfer_cross_chain"
Expand Down
2 changes: 1 addition & 1 deletion x/erc20/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (

TypeMsgRegisterCoin = "register_coin"
TypeMsgRegisterERC20 = "register_erc20"
TypeMsgToggleTokenConversion = "toggle_token_conversion" //nolint:gosec #nosec G101
TypeMsgToggleTokenConversion = "toggle_token_conversion" // #nosec G101
TypeMsgUpdateDenomAlias = "update_denom_alias"
)

Expand Down
2 changes: 1 addition & 1 deletion x/erc20/types/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
const (
ProposalTypeRegisterCoin string = "RegisterCoin"
ProposalTypeRegisterERC20 string = "RegisterERC20"
ProposalTypeToggleTokenConversion string = "ToggleTokenConversion" // #nosec
ProposalTypeToggleTokenConversion string = "ToggleTokenConversion" // #nosec G101
ProposalTypeUpdateDenomAlias string = "UpdateDenomAlias"
)

Expand Down
2 changes: 1 addition & 1 deletion x/staking/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const (
EventTypeTransferShares = "transfer_shares"
EventTypeGrantPrivilege = "grant_privilege"
EventTypeEditConsensusPubKey = "edit_consensus_pubkey"
EventTypeEditingConsensusPubKey = "editing_consensus_pubkey"
EventTypeEditingConsensusPubKey = "editing_consensus_pubkey" //nolint:gosec
EventTypeEditedConsensusPubKey = "edited_consensus_pubkey"

AttributeKeyOwner = "owner"
Expand Down

0 comments on commit 924acd9

Please sign in to comment.