Skip to content

Commit

Permalink
Go 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris committed Feb 15, 2024
1 parent 7dd7061 commit cc574e0
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 21 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.21
go-version: ^1.22
id: go

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

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

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

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/[email protected].2
run: go install honnef.co/go/tools/cmd/[email protected].6

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

- 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 @@ -28,6 +28,7 @@ linters:
- varcheck
- depguard
- exhaustruct
- perfsprint

#
# Disabled because of generics:
Expand Down
2 changes: 1 addition & 1 deletion collector/node_conn_bloxroute.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (nc *BlxNodeConnection) connect() {

// fmt.Println("got message", string(nextNotification))
var txMsg common.BlxRawTxMsg
err = json.Unmarshal(nextNotification, &txMsg)
err = json.Unmarshal(nextNotification, &txMsg) //nolint:musttag
if err != nil {
nc.log.Errorw("failed to unmarshal message", "error", err)
continue
Expand Down
2 changes: 1 addition & 1 deletion collector/node_conn_eden.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (nc *EdenNodeConnection) connect() {

// fmt.Println("got message", string(nextNotification))
var txMsg common.EdenRawTxMsg
err = json.Unmarshal(nextNotification, &txMsg)
err = json.Unmarshal(nextNotification, &txMsg) //nolint:musttag
if err != nil {
nc.log.Errorw("failed to unmarshal message", "error", err)
continue
Expand Down
2 changes: 1 addition & 1 deletion common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestParquet(t *testing.T) {
pr.ReadStop()
fr.Close()

require.Equal(t, 1, len(entries))
require.Len(t, entries, 1)
tx := entries[0]

require.Equal(t, summary.Timestamp, tx.Timestamp)
Expand Down
5 changes: 2 additions & 3 deletions common/txsfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"archive/zip"
"bufio"
"errors"
"fmt"
"io"
"os"
"strconv"
Expand Down Expand Up @@ -184,8 +183,8 @@ func ParseTx(timestampMs int64, rawTxHex string) (TxSummaryEntry, *types.Transac
From: strings.ToLower(from.Hex()),
To: strings.ToLower(to),
Value: tx.Value().String(),
Nonce: fmt.Sprint(tx.Nonce()),
Gas: fmt.Sprint(tx.Gas()),
Nonce: strconv.FormatUint(tx.Nonce(), 10),
Gas: strconv.FormatUint(tx.Gas(), 10),
GasPrice: tx.GasPrice().String(),
GasTipCap: tx.GasTipCap().String(),
GasFeeCap: tx.GasFeeCap().String(),
Expand Down
15 changes: 8 additions & 7 deletions common/txsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"math"
"strconv"
"strings"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -110,23 +111,23 @@ func (t *TxSummaryEntry) WasIncludedBeforeReceived() bool {

func (t *TxSummaryEntry) ToCSVRow() []string {
return []string{
fmt.Sprint(t.Timestamp),
strconv.FormatInt(t.Timestamp, 10),
t.Hash,
t.ChainID,
t.From,
t.To,
t.Value,
fmt.Sprint(t.Nonce),
fmt.Sprint(t.Gas),
t.Nonce,
t.Gas,
t.GasPrice,
t.GasTipCap,
t.GasFeeCap,
fmt.Sprint(t.DataSize),
strconv.FormatInt(t.DataSize, 10),
t.Data4Bytes,
strings.Join(t.Sources, " "),
fmt.Sprint(t.IncludedAtBlockHeight),
fmt.Sprint(t.IncludedBlockTimestamp),
fmt.Sprint(t.InclusionDelayMs),
strconv.FormatInt(t.IncludedAtBlockHeight, 10),
strconv.FormatInt(t.IncludedBlockTimestamp, 10),
strconv.FormatInt(t.InclusionDelayMs, 10),
}
}

Expand Down
4 changes: 2 additions & 2 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"strings"
)

type BlxRawTxMsg struct { //nolint:musttag
type BlxRawTxMsg struct {
Params struct {
Result struct {
RawTx string
}
}
}

type EdenRawTxMsg struct { //nolint:musttag
type EdenRawTxMsg struct {
Params struct {
Result struct {
RLP string
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/mempool-dumpster

go 1.21
go 1.22

require (
github.com/HdrHistogram/hdrhistogram-go v1.1.2
Expand Down

0 comments on commit cc574e0

Please sign in to comment.