Skip to content

Commit

Permalink
add missing linters
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteHerrmann committed Aug 23, 2024
1 parent 175c482 commit a3c4f48
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions precompiles/bank/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ func (s *PrecompileTestSuite) TestBalances() {
}

for _, tc := range testcases {
tc := tc

s.Run(tc.name, func() {
s.SetupTest()

Expand Down Expand Up @@ -138,8 +136,6 @@ func (s *PrecompileTestSuite) TestTotalSupply() {
}

for _, tc := range testcases {
tc := tc

s.Run(tc.name, func() {
s.SetupTest()

Expand Down Expand Up @@ -231,8 +227,6 @@ func (s *PrecompileTestSuite) TestSupplyOf() {
}

for _, tc := range testcases {
tc := tc

s.Run(tc.name, func() {
s.SetupTest()

Expand Down
4 changes: 2 additions & 2 deletions precompiles/staking/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ func (vo *ValidatorOutput) FromResponse(res *stakingtypes.QueryValidatorResponse
OperatorAddress: common.BytesToAddress(operatorAddress.Bytes()).String(),
ConsensusPubkey: FormatConsensusPubkey(res.Validator.ConsensusPubkey),
Jailed: res.Validator.Jailed,
Status: uint8(stakingtypes.BondStatus_value[res.Validator.Status.String()]),
Status: uint8(stakingtypes.BondStatus_value[res.Validator.Status.String()]), //#nosec G115 // enum will always be convertible to uint8
Tokens: res.Validator.Tokens.BigInt(),
DelegatorShares: res.Validator.DelegatorShares.BigInt(), // TODO: Decimal
// TODO: create description type,
Expand Down Expand Up @@ -675,7 +675,7 @@ func (vo *ValidatorsOutput) FromResponse(res *stakingtypes.QueryValidatorsRespon
OperatorAddress: common.BytesToAddress(operatorAddress.Bytes()).String(),
ConsensusPubkey: FormatConsensusPubkey(v.ConsensusPubkey),
Jailed: v.Jailed,
Status: uint8(stakingtypes.BondStatus_value[v.Status.String()]),
Status: uint8(stakingtypes.BondStatus_value[v.Status.String()]), //#nosec G115 // enum will always be convertible to uint8
Tokens: v.Tokens.BigInt(),
DelegatorShares: v.DelegatorShares.BigInt(),
Description: v.Description.Details,
Expand Down
2 changes: 1 addition & 1 deletion precompiles/staking/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func (s *PrecompileTestSuite) assertValidatorsResponse(validators []staking.Vali
j := valOrder[i]

s.Require().Equal(s.validators[j].OperatorAddress, sdk.ValAddress(common.HexToAddress(validators[i].OperatorAddress).Bytes()).String())
s.Require().Equal(uint8(s.validators[j].Status), validators[i].Status)
s.Require().Equal(uint8(s.validators[j].Status), validators[i].Status) //#nosec G115 // enum is safe
s.Require().Equal(s.validators[j].Tokens.Uint64(), validators[i].Tokens.Uint64())
s.Require().Equal(s.validators[j].DelegatorShares.BigInt(), validators[i].DelegatorShares)
s.Require().Equal(s.validators[j].Jailed, validators[i].Jailed)
Expand Down
2 changes: 1 addition & 1 deletion x/erc20/keeper/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (k Keeper) DeployERC20Contract(
decimals := uint8(0)
if len(coinMetadata.DenomUnits) > 0 {
decimalsIdx := len(coinMetadata.DenomUnits) - 1
decimals = uint8(coinMetadata.DenomUnits[decimalsIdx].Exponent)
decimals = uint8(coinMetadata.DenomUnits[decimalsIdx].Exponent) //#nosec G115 // exponent will not exceed uint8
}
ctorArgs, err := contracts.ERC20MinterBurnerDecimalsContract.ABI.Pack(
"",
Expand Down

0 comments on commit a3c4f48

Please sign in to comment.