From 92004d8a481908a2f21aa4c1dd7685639f0b2bc4 Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 4 Oct 2023 18:56:10 -0300 Subject: [PATCH 1/4] Update CONTRIBUITING.md doc --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c033116..34c6b041 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,8 +11,8 @@ Install a few dev dependencies for `make lint`: ```bash go install github.com/mgechev/revive@v1.1.3 go install mvdan.cc/gofumpt@v0.3.1 -go install honnef.co/go/tools/cmd/staticcheck@v0.3.0 -go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0 +go install honnef.co/go/tools/cmd/staticcheck@v0.4.0 +go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 ``` Look at the [README for instructions to install the dependencies and build `mev-boost`](README.md#installing) From 8c61c611c63f147d133aa689adab6188bb8f3456 Mon Sep 17 00:00:00 2001 From: Marcos Date: Thu, 5 Oct 2023 18:21:39 -0300 Subject: [PATCH 2/4] match docs dependencies with ci version --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34c6b041..6d0e4c86 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,8 +11,8 @@ Install a few dev dependencies for `make lint`: ```bash go install github.com/mgechev/revive@v1.1.3 go install mvdan.cc/gofumpt@v0.3.1 -go install honnef.co/go/tools/cmd/staticcheck@v0.4.0 -go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 +go install honnef.co/go/tools/cmd/staticcheck@v0.4.2 +go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 ``` Look at the [README for instructions to install the dependencies and build `mev-boost`](README.md#installing) From 74560a0bb9d39e1859fb379975c5ef2d8333901b Mon Sep 17 00:00:00 2001 From: Marcos Date: Thu, 19 Oct 2023 19:11:16 -0300 Subject: [PATCH 3/4] add unit tests for beacon script --- cmd/test-cli/beacon_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cmd/test-cli/beacon_test.go diff --git a/cmd/test-cli/beacon_test.go b/cmd/test-cli/beacon_test.go new file mode 100644 index 00000000..5ef27d06 --- /dev/null +++ b/cmd/test-cli/beacon_test.go @@ -0,0 +1,26 @@ +package main + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestBeacon(t *testing.T) { + + t.Run("create beacon: BeaconNode", func(t *testing.T) { + isMergemock := false + beaconEndpoint := "http://localhost:5052" + engineEndpoint := "http://localhost:5053" + beacon := createBeacon(isMergemock, beaconEndpoint, engineEndpoint) + require.Equal(t, &BeaconNode{beaconEndpoint}, beacon) + }) + + t.Run("create beacon: MergemockBeacon", func(t *testing.T) { + isMergemock := true + beaconEndpoint := "http://localhost:5052" + engineEndpoint := "http://localhost:5053" + beacon := createBeacon(isMergemock, beaconEndpoint, engineEndpoint) + require.Equal(t, &MergemockBeacon{engineEndpoint}, beacon) + }) +} From f174c47dc2640698d3205038111a695fb9e5f63b Mon Sep 17 00:00:00 2001 From: Marcos Date: Thu, 19 Oct 2023 21:24:41 -0300 Subject: [PATCH 4/4] run make lint --- cmd/test-cli/beacon_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/test-cli/beacon_test.go b/cmd/test-cli/beacon_test.go index 5ef27d06..6c8407f2 100644 --- a/cmd/test-cli/beacon_test.go +++ b/cmd/test-cli/beacon_test.go @@ -7,7 +7,6 @@ import ( ) func TestBeacon(t *testing.T) { - t.Run("create beacon: BeaconNode", func(t *testing.T) { isMergemock := false beaconEndpoint := "http://localhost:5052"