Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Apr 25, 2024
1 parent c381396 commit ac2554f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rpc/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestHTTPRespBodyUnlimited(t *testing.T) {
logger := log.New()
const respLength = maxRequestContentLength * 3

s := NewServer(50, false /* traceRequests */, true, logger, 100)
s := NewServer(50, false /* traceRequests */, false /* debugSingleRequests */, true, logger, 100)
defer s.Stop()
if err := s.RegisterName("test", largeRespService{respLength}); err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion rpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (

func TestServerRegisterName(t *testing.T) {
logger := log.New()
server := NewServer(50, false /* traceRequests */, true, logger, 100)
server := NewServer(50, false /* traceRequests */, false /* debugSingleRequests */, true, logger, 100)
service := new(testService)

if err := server.RegisterName("test", service); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion rpc/subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestSubscriptions(t *testing.T) {
subCount = len(namespaces)
notificationCount = 3

server = NewServer(50, false /* traceRequests */, true, logger, 100)
server = NewServer(50, false /* traceRequests */, false /* debugSingleRequests */, true, logger, 100)
clientConn, serverConn = net.Pipe()
out = json.NewEncoder(clientConn)
in = json.NewDecoder(clientConn)
Expand Down
2 changes: 1 addition & 1 deletion rpc/testservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

func newTestServer(logger log.Logger) *Server {
server := NewServer(50, false /* traceRequests */, true, logger, 100)
server := NewServer(50, false /* traceRequests */, false /* debugSingleRequests */, true, logger, 100)
server.idgen = sequentialIDGenerator()
if err := server.RegisterName("test", new(testService)); err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion rpc/websocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func TestClientWebsocketPing(t *testing.T) {
func TestClientWebsocketLargeMessage(t *testing.T) {
logger := log.New()
var (
srv = NewServer(50, false /* traceRequests */, true, logger, 100)
srv = NewServer(50, false /* traceRequests */, false /* debugSingleRequests */, true, logger, 100)
httpsrv = httptest.NewServer(srv.WebsocketHandler(nil, nil, false, logger))
wsURL = "ws:" + strings.TrimPrefix(httpsrv.URL, "http:")
)
Expand Down
9 changes: 5 additions & 4 deletions turbo/jsonrpc/get_chain_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package jsonrpc

import (
"context"
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest"
"testing"

"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest"
)

func TestGetChainConfig(t *testing.T) {
m, _, _ := rpcdaemontest.CreateTestSentry(t)
db := m.DB
db, ctx := m.DB, m.Ctx
api := newBaseApiForTest(m)
config := m.ChainConfig

Expand All @@ -18,14 +19,14 @@ func TestGetChainConfig(t *testing.T) {
}
defer tx.Rollback()

config1, err1 := api.chainConfig(tx)
config1, err1 := api.chainConfig(ctx, tx)
if err1 != nil {
t.Fatalf("reading chain config: %v", err1)
}
if config.String() != config1.String() {
t.Fatalf("read different config: %s, expected %s", config1.String(), config.String())
}
config2, err2 := api.chainConfig(tx)
config2, err2 := api.chainConfig(ctx, tx)
if err2 != nil {
t.Fatalf("reading chain config: %v", err2)
}
Expand Down

0 comments on commit ac2554f

Please sign in to comment.