Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.24.0
require (
github.com/VictoriaMetrics/metrics v1.35.1
github.com/ethereum/go-ethereum v1.15.5
github.com/goccy/go-json v0.10.5
github.com/google/uuid v1.3.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.10.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down
3 changes: 2 additions & 1 deletion jsonrpc/mockserver.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package jsonrpc

import (
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"sync"

"github.com/goccy/go-json"

"github.com/ethereum/go-ethereum/log"
)

Expand Down
3 changes: 2 additions & 1 deletion jsonrpc/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package jsonrpc

import (
"bytes"
"encoding/json"
"errors"
"net/http"

"github.com/goccy/go-json"
)

type JSONRPCRequest struct {
Expand Down
3 changes: 2 additions & 1 deletion jsonrpc/request_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package jsonrpc

import (
"encoding/json"
"testing"

"github.com/goccy/go-json"

"github.com/stretchr/testify/assert"
)

Expand Down
3 changes: 2 additions & 1 deletion jsonrpc/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
package jsonrpc

import (
"encoding/json"
"fmt"

"github.com/goccy/go-json"
)

// As per JSON-RPC 2.0 Specification
Expand Down
3 changes: 2 additions & 1 deletion rpcclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ package rpcclient
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"strconv"

"github.com/goccy/go-json"

"github.com/flashbots/go-utils/signature"
)

Expand Down
3 changes: 2 additions & 1 deletion rpcserver/jsonrpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ package rpcserver

import (
"context"
"encoding/json"
"fmt"
"io"
"log/slog"
"net/http"
"strings"
"time"

"github.com/goccy/go-json"

"github.com/ethereum/go-ethereum/common"
"github.com/flashbots/go-utils/signature"
)
Expand Down
4 changes: 2 additions & 2 deletions rpcserver/jsonrpc_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
},
"invalid json": {
requestBody: `{"jsonrpc":"2.0","id":1,"method":"function","params":[1]`,
expectedResponse: `{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"unexpected end of JSON input"}}`,
expectedResponse: `{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"expected comma after object element"}}`,
},
"method not found": {
requestBody: `{"jsonrpc":"2.0","id":1,"method":"not_found","params":[1]}`,
Expand All @@ -63,7 +63,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
},
"invalid params type": {
requestBody: `{"jsonrpc":"2.0","id":1,"method":"function","params":["1"]}`,
expectedResponse: `{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"json: cannot unmarshal string into Go value of type int"}}`,
expectedResponse: `{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"json: cannot unmarshal number \" into Go value of type int"}}`,
},
}

Expand Down
3 changes: 2 additions & 1 deletion rpcserver/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package rpcserver

import (
"context"
"encoding/json"
"errors"
"reflect"

"github.com/goccy/go-json"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion rpcserver/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package rpcserver

import (
"context"
"encoding/json"
"errors"
"fmt"
"testing"

"github.com/goccy/go-json"

"github.com/stretchr/testify/require"
)

Expand Down
3 changes: 2 additions & 1 deletion rpctypes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"bytes"
"crypto/sha256"
"encoding/binary"
"encoding/json"
"errors"
"hash"
"math/big"
"sort"

"github.com/goccy/go-json"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
Expand Down
3 changes: 2 additions & 1 deletion rpctypes/types_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package rpctypes

import (
"encoding/json"
"fmt"
"testing"

"github.com/goccy/go-json"

"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/stretchr/testify/require"
)
Expand Down