Skip to content

Commit

Permalink
update lint
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonche committed Feb 13, 2024
1 parent d97a43f commit 7ae5cbc
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.20
go-version: ^1.21
id: go

- name: Check out code into the Go module directory
Expand All @@ -40,20 +40,20 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.20
go-version: ^1.21
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install gofumpt
run: go install mvdan.cc/gofumpt@v0.4.0

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.2
run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.6

- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.0

- name: Lint
run: make lint
Expand Down
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ linters:
- deadcode
- varcheck
- interfacebloat
- exhaustruct

#
# Disabled because of generics:
Expand Down
16 changes: 8 additions & 8 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ type BuilderGetValidatorsResponseEntry struct {

type BidTraceV2 struct {
builderApiV1.BidTrace
BlockNumber uint64 `db:"block_number" json:"block_number,string"`
NumTx uint64 `db:"num_tx" json:"num_tx,string"`
BlockNumber uint64 `db:"block_number" json:"block_number,string"`
NumTx uint64 `db:"num_tx" json:"num_tx,string"`
}

type BidTraceV2JSON struct {
Expand Down Expand Up @@ -599,7 +599,7 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e
s.Message = new(builderApiV1.BidTrace)
}
if dst, err = s.Message.MarshalSSZTo(dst); err != nil {
return
return nil, err
}

// Offset (1) 'ExecutionPayloadHeader'
Expand All @@ -624,13 +624,13 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e

// Field (1) 'ExecutionPayloadHeader'
if dst, err = s.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil {
return
return nil, err
}

// Field (3) 'Transactions'
if size := len(s.Transactions); size > 1073741824 {
err = ssz.ErrListTooBigFn("SubmitBlockRequestV2Optimistic.Transactions", size, 1073741824)
return
return nil, err
}
{
offset = 4 * len(s.Transactions)
Expand All @@ -642,19 +642,19 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e
for ii := 0; ii < len(s.Transactions); ii++ {
if size := len(s.Transactions[ii]); size > 1073741824 {
err = ssz.ErrBytesLengthFn("SubmitBlockRequestV2Optimistic.Transactions[ii]", size, 1073741824)
return
return nil, err
}
dst = append(dst, s.Transactions[ii]...)
}

// Field (4) 'Withdrawals'
if size := len(s.Withdrawals); size > 16 {
err = ssz.ErrListTooBigFn("SubmitBlockRequestV2Optimistic.Withdrawals", size, 16)
return
return nil, err
}
for ii := 0; ii < len(s.Withdrawals); ii++ {
if dst, err = s.Withdrawals[ii].MarshalSSZTo(dst); err != nil {
return
return nil, err
}
}
return dst, nil
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/flashbots/mev-boost-relay

go 1.20
go 1.21

require (
github.com/NYTimes/gziphandler v1.1.1
Expand Down
Loading

0 comments on commit 7ae5cbc

Please sign in to comment.