diff --git a/http/proxy.go b/http/proxy.go index 203f54d1..8de56bbc 100644 --- a/http/proxy.go +++ b/http/proxy.go @@ -27,6 +27,8 @@ func (s *Service) Proxy(ctx context.Context, req *http.Request) (*http.Response, } // proxy performs an HTTP proxy request using a reverse proxy and returns the response. +// +//nolint:revive func (s *Service) proxy(ctx context.Context, req *http.Request) (*http.Response, error) { endpoint := req.URL.Path query := req.URL.Query().Encode() diff --git a/mock/beaconblockattestations.go b/mock/beaconblockattestations.go index 6e530657..f0f1bb2c 100644 --- a/mock/beaconblockattestations.go +++ b/mock/beaconblockattestations.go @@ -16,11 +16,11 @@ package mock import ( "context" + "github.com/OffchainLabs/go-bitfield" "github.com/attestantio/go-eth2-client/api" "github.com/attestantio/go-eth2-client/spec" "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/spec/phase0" - "github.com/prysmaticlabs/go-bitfield" ) // BeaconBlockAttestations fetches a block's attestations given a block ID. @@ -35,7 +35,7 @@ func (s *Service) BeaconBlockAttestations(ctx context.Context, } attestations := make([]*spec.VersionedAttestation, 4) - for i := uint64(0); i < 4; i++ { + for i := range uint64(4) { aggregationBits := bitfield.NewBitlist(128) aggregationBits.SetBitAt(i, true) attestations[i] = &spec.VersionedAttestation{ diff --git a/spec/bellatrix/executionpayload.go b/spec/bellatrix/executionpayload.go index 29eab102..e4d9988b 100644 --- a/spec/bellatrix/executionpayload.go +++ b/spec/bellatrix/executionpayload.go @@ -289,7 +289,8 @@ func (e *ExecutionPayload) unpack(data *executionPayloadJSON) error { baseFeePerGasBEBytes := baseFeePerGas.Bytes() var baseFeePerGasLEBytes [32]byte baseFeeLen := len(baseFeePerGasBEBytes) - for i := 0; i < baseFeeLen; i++ { + for i := range baseFeeLen { + //nolint:gosec baseFeePerGasLEBytes[i] = baseFeePerGasBEBytes[baseFeeLen-1-i] } copy(e.BaseFeePerGas[:], baseFeePerGasLEBytes[:]) diff --git a/spec/bellatrix/executionpayloadheader.go b/spec/bellatrix/executionpayloadheader.go index 92d7139f..0a4bd901 100644 --- a/spec/bellatrix/executionpayloadheader.go +++ b/spec/bellatrix/executionpayloadheader.go @@ -284,7 +284,8 @@ func (e *ExecutionPayloadHeader) unpack(data *executionPayloadHeaderJSON) error baseFeePerGasBEBytes := baseFeePerGas.Bytes() var baseFeePerGasLEBytes [32]byte baseFeeLen := len(baseFeePerGasBEBytes) - for i := 0; i < baseFeeLen; i++ { + for i := range baseFeeLen { + //nolint:gosec baseFeePerGasLEBytes[i] = baseFeePerGasBEBytes[baseFeeLen-1-i] } copy(e.BaseFeePerGas[:], baseFeePerGasLEBytes[:]) diff --git a/spec/capella/executionpayload.go b/spec/capella/executionpayload.go index f563711a..664006a6 100644 --- a/spec/capella/executionpayload.go +++ b/spec/capella/executionpayload.go @@ -296,7 +296,8 @@ func (e *ExecutionPayload) unpack(data *executionPayloadJSON) error { baseFeePerGasBEBytes := baseFeePerGas.Bytes() var baseFeePerGasLEBytes [32]byte baseFeeLen := len(baseFeePerGasBEBytes) - for i := 0; i < baseFeeLen; i++ { + for i := range baseFeeLen { + //nolint:gosec baseFeePerGasLEBytes[i] = baseFeePerGasBEBytes[baseFeeLen-1-i] } copy(e.BaseFeePerGas[:], baseFeePerGasLEBytes[:]) diff --git a/spec/capella/executionpayloadheader.go b/spec/capella/executionpayloadheader.go index 61cff023..3b119a49 100644 --- a/spec/capella/executionpayloadheader.go +++ b/spec/capella/executionpayloadheader.go @@ -289,7 +289,8 @@ func (e *ExecutionPayloadHeader) unpack(data *executionPayloadHeaderJSON) error baseFeePerGasBEBytes := baseFeePerGas.Bytes() var baseFeePerGasLEBytes [32]byte baseFeeLen := len(baseFeePerGasBEBytes) - for i := 0; i < baseFeeLen; i++ { + for i := range baseFeeLen { + //nolint:gosec baseFeePerGasLEBytes[i] = baseFeePerGasBEBytes[baseFeeLen-1-i] } copy(e.BaseFeePerGas[:], baseFeePerGasLEBytes[:])