Skip to content

Commit

Permalink
various cleanup, update to go 1.18, go-ethereum 1.10.17 (#11)
Browse files Browse the repository at this point in the history
* private-tx preferences: fast mode

* various cleanup, update to go 1.18, go-ethereum 1.10.17
  • Loading branch information
metachris authored Mar 30, 2022
1 parent 2981de1 commit 1146f37
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 72 deletions.
52 changes: 35 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
on: [push, pull_request]
name: Test

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

name: Test
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go

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

- name: Test
run: make test

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go

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

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

- name: Lint
run: gofmt -d ./
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@master

- name: Test
run: go test ./...
- name: Lint
run: make lint
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
GIT_VER := $(shell git describe --tags --always --dirty="-dev")

all: lint test

v:
@echo "Version: ${GIT_VER}"

test:
go test ./...

lint:
gofmt -d ./
go vet ./...
staticcheck ./...

cover:
go test -coverprofile=/tmp/go-sim-lb.cover.tmp ./...
go tool cover -func /tmp/go-sim-lb.cover.tmp
unlink /tmp/go-sim-lb.cover.tmp

cover-html:
go test -coverprofile=/tmp/go-sim-lb.cover.tmp ./...
go tool cover -html=/tmp/go-sim-lb.cover.tmp
unlink /tmp/go-sim-lb.cover.tmp
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Flashbots RPC client

[![Test status](https://github.com/metachris/flashbotsrpc/workflows/Test/badge.svg)](https://github.com/metachris/flashbotsrpc/actions?query=workflow%3A%22Test%22)

Fork of [ethrpc](https://github.com/onrik/ethrpc) with additional [Flashbots RPC methods](https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint):

* `FlashbotsCallBundle` ([`eth_callBundle`](https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint/#eth_callbundle))
Expand Down
6 changes: 4 additions & 2 deletions flashbotsrpc_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package flashbotsrpc

//lint:file-ignore SA4006 ignore for now

import (
"crypto/ecdsa"
"errors"
Expand Down Expand Up @@ -1118,12 +1120,12 @@ func (s *FlashbotsRPCTestSuite) TestEthGetLogs() {
}]`
s.registerResponse(result, func(body []byte) {
s.methodEqual(body, "eth_getLogs")
s.paramsEqual(body, fmt.Sprintf(`[{
s.paramsEqual(body, `[{
"fromBlock": "0x1",
"toBlock": "0x10",
"address": ["0x8888f1f195afa192cfee860698584c030f4c9db1"],
"topics": [["0x111"], null]
}]`))
}]`)
})

logs, err := s.rpc.EthGetLogs(params)
Expand Down
29 changes: 24 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
module github.com/metachris/flashbotsrpc

go 1.16
go 1.18

require (
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/ethereum/go-ethereum v1.10.8
github.com/ethereum/go-ethereum v1.10.17
github.com/jarcoal/httpmock v1.0.8
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
github.com/tidwall/gjson v1.8.1
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7 // indirect
)

require (
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/btcsuite/btcd/btcec/v2 v2.1.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/tidwall/match v1.0.3 // indirect
github.com/tidwall/pretty v1.1.0 // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 // indirect
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading

0 comments on commit 1146f37

Please sign in to comment.