Skip to content

Commit

Permalink
appease gosec
Browse files Browse the repository at this point in the history
  • Loading branch information
abi87 committed Nov 12, 2024
1 parent b18ef77 commit f4555ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mod/state-transition/pkg/core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,10 @@ func (s *StateDB[
// on Bartio, for backward compatibility reasons, no withdrawal case
// is handled via a list of empty withdrawals (rather than an empty list).
// TODO: drop this when we drop other Bartio special cases.
if len(withdrawals) < int(s.cs.MaxWithdrawalsPerPayload()) &&
s.cs.DepositEth1ChainID() == spec.BartioChainID {
//
//#nosec:G701 // len(withdrawals) won't ever be negative.
if s.cs.DepositEth1ChainID() == spec.BartioChainID &&
len(withdrawals) < int(s.cs.MaxWithdrawalsPerPayload()) {
for range int(s.cs.DepositEth1ChainID()) - len(withdrawals) {
var w WithdrawalT
withdrawals = append(withdrawals, w)
Expand Down

0 comments on commit f4555ac

Please sign in to comment.