Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit 1146f37

Browse files
authored
various cleanup, update to go 1.18, go-ethereum 1.10.17 (metachris#11)
* private-tx preferences: fast mode * various cleanup, update to go 1.18, go-ethereum 1.10.17
1 parent 2981de1 commit 1146f37

File tree

6 files changed

+148
-72
lines changed

6 files changed

+148
-72
lines changed

.github/workflows/test.yml

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
1-
on: [push, pull_request]
21
name: Test
2+
3+
on: [push, pull_request]
4+
35
jobs:
46
test:
5-
strategy:
6-
matrix:
7-
go-version: [1.16.x, 1.17.x]
8-
os: [ubuntu-latest, macos-latest, windows-latest]
9-
runs-on: ${{ matrix.os }}
10-
7+
name: Test
8+
runs-on: ubuntu-latest
119
steps:
12-
- name: Install Go
13-
uses: actions/setup-go@v2
14-
with:
15-
go-version: ${{ matrix.go-version }}
10+
- name: Set up Go 1.x
11+
uses: actions/setup-go@v2
12+
with:
13+
go-version: ^1.18
14+
id: go
15+
16+
- name: Check out code into the Go module directory
17+
uses: actions/checkout@v2
18+
19+
- name: Test
20+
run: make test
21+
22+
lint:
23+
name: Lint
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Set up Go 1.x
27+
uses: actions/setup-go@v2
28+
with:
29+
go-version: ^1.18
30+
id: go
31+
32+
- name: Check out code into the Go module directory
33+
uses: actions/checkout@v2
1634

17-
- name: Checkout code
18-
uses: actions/checkout@v2
35+
- name: Install revive linter
36+
run: go install github.com/mgechev/[email protected]
1937

20-
- name: Lint
21-
run: gofmt -d ./
38+
- name: Install staticcheck
39+
run: go install honnef.co/go/tools/cmd/staticcheck@master
2240

23-
- name: Test
24-
run: go test ./...
41+
- name: Lint
42+
run: make lint

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
GIT_VER := $(shell git describe --tags --always --dirty="-dev")
2+
3+
all: lint test
4+
5+
v:
6+
@echo "Version: ${GIT_VER}"
7+
8+
test:
9+
go test ./...
10+
11+
lint:
12+
gofmt -d ./
13+
go vet ./...
14+
staticcheck ./...
15+
16+
cover:
17+
go test -coverprofile=/tmp/go-sim-lb.cover.tmp ./...
18+
go tool cover -func /tmp/go-sim-lb.cover.tmp
19+
unlink /tmp/go-sim-lb.cover.tmp
20+
21+
cover-html:
22+
go test -coverprofile=/tmp/go-sim-lb.cover.tmp ./...
23+
go tool cover -html=/tmp/go-sim-lb.cover.tmp
24+
unlink /tmp/go-sim-lb.cover.tmp

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Flashbots RPC client
22

3+
[![Test status](https://github.com/metachris/flashbotsrpc/workflows/Test/badge.svg)](https://github.com/metachris/flashbotsrpc/actions?query=workflow%3A%22Test%22)
4+
35
Fork of [ethrpc](https://github.com/onrik/ethrpc) with additional [Flashbots RPC methods](https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint):
46

57
* `FlashbotsCallBundle` ([`eth_callBundle`](https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint/#eth_callbundle))

flashbotsrpc_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package flashbotsrpc
22

3+
//lint:file-ignore SA4006 ignore for now
4+
35
import (
46
"crypto/ecdsa"
57
"errors"
@@ -1118,12 +1120,12 @@ func (s *FlashbotsRPCTestSuite) TestEthGetLogs() {
11181120
}]`
11191121
s.registerResponse(result, func(body []byte) {
11201122
s.methodEqual(body, "eth_getLogs")
1121-
s.paramsEqual(body, fmt.Sprintf(`[{
1123+
s.paramsEqual(body, `[{
11221124
"fromBlock": "0x1",
11231125
"toBlock": "0x10",
11241126
"address": ["0x8888f1f195afa192cfee860698584c030f4c9db1"],
11251127
"topics": [["0x111"], null]
1126-
}]`))
1128+
}]`)
11271129
})
11281130

11291131
logs, err := s.rpc.EthGetLogs(params)

go.mod

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
module github.com/metachris/flashbotsrpc
22

3-
go 1.16
3+
go 1.18
44

55
require (
6-
github.com/btcsuite/btcd v0.22.0-beta // indirect
7-
github.com/ethereum/go-ethereum v1.10.8
6+
github.com/ethereum/go-ethereum v1.10.17
87
github.com/jarcoal/httpmock v1.0.8
98
github.com/pkg/errors v0.9.1
109
github.com/stretchr/testify v1.7.0
1110
github.com/tidwall/gjson v1.8.1
12-
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
13-
golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7 // indirect
11+
)
12+
13+
require (
14+
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
15+
github.com/btcsuite/btcd v0.22.0-beta // indirect
16+
github.com/btcsuite/btcd/btcec/v2 v2.1.3 // indirect
17+
github.com/davecgh/go-spew v1.1.1 // indirect
18+
github.com/deckarep/golang-set v1.8.0 // indirect
19+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
20+
github.com/go-ole/go-ole v1.2.1 // indirect
21+
github.com/go-stack/stack v1.8.0 // indirect
22+
github.com/gorilla/websocket v1.4.2 // indirect
23+
github.com/pmezard/go-difflib v1.0.0 // indirect
24+
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
25+
github.com/tidwall/match v1.0.3 // indirect
26+
github.com/tidwall/pretty v1.1.0 // indirect
27+
github.com/tklauser/go-sysconf v0.3.5 // indirect
28+
github.com/tklauser/numcpus v0.2.2 // indirect
29+
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 // indirect
30+
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f // indirect
31+
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
32+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
1433
)

0 commit comments

Comments
 (0)