From 14b408d3097b8d224c1612f814246595f4130594 Mon Sep 17 00:00:00 2001 From: Acha Bill Date: Thu, 16 May 2024 12:02:42 +0100 Subject: [PATCH] chore: remove debugAPI option in testserver --- pkg/api/accounting_test.go | 2 -- pkg/api/api_test.go | 1 - pkg/api/balances_test.go | 14 ++--------- pkg/api/chequebook_test.go | 17 +------------ pkg/api/debugstorage_test.go | 3 +-- pkg/api/logger_test.go | 8 +++--- pkg/api/p2p_test.go | 2 -- pkg/api/peer_test.go | 10 ++------ pkg/api/pingpong_test.go | 3 +-- pkg/api/postage_test.go | 43 +++++++++------------------------ pkg/api/redistribution_test.go | 2 -- pkg/api/settlements_test.go | 8 +----- pkg/api/staking_test.go | 22 ++++++++--------- pkg/api/status_test.go | 4 +-- pkg/api/topology_test.go | 2 +- pkg/api/transaction_test.go | 10 -------- pkg/api/wallet_test.go | 15 ++---------- pkg/api/welcome_message_test.go | 5 +--- 18 files changed, 38 insertions(+), 133 deletions(-) diff --git a/pkg/api/accounting_test.go b/pkg/api/accounting_test.go index 7a807aa811e..c2db87d2cdb 100644 --- a/pkg/api/accounting_test.go +++ b/pkg/api/accounting_test.go @@ -56,7 +56,6 @@ func TestAccountingInfo(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithPeerAccountingFunc(accountingFunc)}, }) @@ -112,7 +111,6 @@ func TestAccountingInfoError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithPeerAccountingFunc(accountingFunc)}, }) diff --git a/pkg/api/api_test.go b/pkg/api/api_test.go index 305ececf6ee..bf2c5288c5a 100644 --- a/pkg/api/api_test.go +++ b/pkg/api/api_test.go @@ -105,7 +105,6 @@ type testServerOptions struct { Steward steward.Interface WsHeaders http.Header Authenticator auth.Authenticator - DebugAPI bool Restricted bool DirectUpload bool Probe *api.Probe diff --git a/pkg/api/balances_test.go b/pkg/api/balances_test.go index 174196d253a..d5434c3d3c8 100644 --- a/pkg/api/balances_test.go +++ b/pkg/api/balances_test.go @@ -32,7 +32,6 @@ func TestBalances(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalancesFunc(compensatedBalancesFunc)}, }) @@ -72,7 +71,6 @@ func TestBalancesError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalancesFunc(compensatedBalancesFunc)}, }) @@ -92,7 +90,6 @@ func TestBalancesPeers(t *testing.T) { return big.NewInt(100000000000000000), nil } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalanceFunc(compensatedBalanceFunc)}, }) @@ -113,7 +110,6 @@ func TestBalancesPeersError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalanceFunc(compensatedBalanceFunc)}, }) @@ -133,7 +129,6 @@ func TestBalancesPeersNoBalance(t *testing.T) { return nil, accounting.ErrPeerNoBalance } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalanceFunc(compensatedBalanceFunc)}, }) @@ -186,7 +181,6 @@ func TestConsumedBalances(t *testing.T) { return ret, err } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalancesFunc(balancesFunc)}, }) @@ -227,7 +221,6 @@ func TestConsumedError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalancesFunc(balancesFunc)}, }) @@ -247,7 +240,6 @@ func TestConsumedPeers(t *testing.T) { return big.NewInt(1000000000000000000), nil } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalanceFunc(balanceFunc)}, }) @@ -268,7 +260,6 @@ func TestConsumedPeersError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalanceFunc(balanceFunc)}, }) @@ -288,7 +279,6 @@ func TestConsumedPeersNoBalance(t *testing.T) { return nil, accounting.ErrPeerNoBalance } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalanceFunc(balanceFunc)}, }) @@ -303,7 +293,7 @@ func TestConsumedPeersNoBalance(t *testing.T) { func Test_peerBalanceHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -352,7 +342,7 @@ func Test_peerBalanceHandler_invalidInputs(t *testing.T) { func Test_compensatedPeerBalanceHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/chequebook_test.go b/pkg/api/chequebook_test.go index b9b9cbdef32..e0276654d45 100644 --- a/pkg/api/chequebook_test.go +++ b/pkg/api/chequebook_test.go @@ -40,7 +40,6 @@ func TestChequebookBalance(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{ mock.WithChequebookBalanceFunc(chequebookBalanceFunc), mock.WithChequebookAvailableBalanceFunc(chequebookAvailableBalanceFunc), @@ -71,7 +70,6 @@ func TestChequebookBalanceError(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookBalanceFunc(chequebookBalanceFunc)}, }) @@ -95,7 +93,6 @@ func TestChequebookAvailableBalanceError(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{ mock.WithChequebookBalanceFunc(chequebookBalanceFunc), mock.WithChequebookAvailableBalanceFunc(chequebookAvailableBalanceFunc), @@ -118,7 +115,6 @@ func TestChequebookAddress(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookAddressFunc(chequebookAddressFunc)}, }) @@ -154,7 +150,6 @@ func TestChequebookWithdraw(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookWithdrawFunc(chequebookWithdrawFunc)}, }) @@ -184,7 +179,6 @@ func TestChequebookWithdraw(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookWithdrawFunc(chequebookWithdrawFunc)}, }) @@ -218,7 +212,6 @@ func TestChequebookDeposit(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookDepositFunc(chequebookDepositFunc)}, }) @@ -249,7 +242,6 @@ func TestChequebookDeposit(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookDepositFunc(chequebookDepositFunc)}, }) @@ -358,7 +350,6 @@ func TestChequebookLastCheques(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithLastReceivedChequesFunc(lastReceivedChequesFunc), swapmock.WithLastSentChequesFunc(lastSentChequesFunc)}, }) @@ -472,7 +463,6 @@ func TestChequebookLastChequesPeer(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithLastReceivedChequeFunc(lastReceivedChequeFunc), swapmock.WithLastSentChequeFunc(lastSentChequeFunc)}, }) @@ -512,7 +502,6 @@ func TestChequebookCashout(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashChequeFunc(cashChequeFunc)}, }) @@ -543,7 +532,6 @@ func TestChequebookCashout_CustomGas(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashChequeFunc(cashChequeFunc)}, }) @@ -619,7 +607,6 @@ func TestChequebookCashoutStatus(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashoutStatusFunc(cashoutStatusFunc)}, }) @@ -667,7 +654,6 @@ func TestChequebookCashoutStatus(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashoutStatusFunc(cashoutStatusFunc)}, }) @@ -706,7 +692,6 @@ func TestChequebookCashoutStatus(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashoutStatusFunc(cashoutStatusFunc)}, }) @@ -733,7 +718,7 @@ func TestChequebookCashoutStatus(t *testing.T) { func Test_chequebookLastPeerHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/debugstorage_test.go b/pkg/api/debugstorage_test.go index bb12a5585fd..14a669f6b10 100644 --- a/pkg/api/debugstorage_test.go +++ b/pkg/api/debugstorage_test.go @@ -35,8 +35,7 @@ func TestDebugStorage(t *testing.T) { } ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, - Storer: mockstorer.NewWithDebugInfo(want), + Storer: mockstorer.NewWithDebugInfo(want), }) jsonhttptest.Request(t, ts, http.MethodGet, "/debugstore", http.StatusOK, diff --git a/pkg/api/logger_test.go b/pkg/api/logger_test.go index b8420b79067..4a3349f6681 100644 --- a/pkg/api/logger_test.go +++ b/pkg/api/logger_test.go @@ -72,7 +72,7 @@ func TestGetLoggers(t *testing.T) { t.Fatalf("unexpected error: %v", err) } - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) jsonhttptest.Request(t, client, http.MethodGet, "/loggers", http.StatusOK, jsonhttptest.WithUnmarshalJSONResponse(&have), ) @@ -88,7 +88,7 @@ func TestSetLoggerVerbosity(t *testing.T) { api.ReplaceLogSetVerbosityByExp(fn) }(api.LogSetVerbosityByExp) - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) type data struct { exp string @@ -143,7 +143,7 @@ func TestSetLoggerVerbosity(t *testing.T) { func Test_loggerGetHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -192,7 +192,7 @@ func Test_loggerGetHandler_invalidInputs(t *testing.T) { func Test_loggerSetVerbosityHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/p2p_test.go b/pkg/api/p2p_test.go index 5cf9de6124c..933596afff7 100644 --- a/pkg/api/p2p_test.go +++ b/pkg/api/p2p_test.go @@ -40,7 +40,6 @@ func TestAddresses(t *testing.T) { ethereumAddress := common.HexToAddress("abcd") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PublicKey: privateKey.PublicKey, PSSPublicKey: pssPrivateKey.PublicKey, Overlay: overlay, @@ -79,7 +78,6 @@ func TestAddresses_error(t *testing.T) { testErr := errors.New("test error") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithAddressesFunc(func() ([]multiaddr.Multiaddr, error) { return nil, testErr })), diff --git a/pkg/api/peer_test.go b/pkg/api/peer_test.go index 0697a6277d2..fdda7b8edf4 100644 --- a/pkg/api/peer_test.go +++ b/pkg/api/peer_test.go @@ -51,7 +51,6 @@ func TestConnect(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithConnectFunc(func(ctx context.Context, addr ma.Multiaddr) (*bzz.Address, error) { if addr.String() == errorUnderlay { return nil, testErr @@ -82,7 +81,6 @@ func TestConnect(t *testing.T) { t.Run("error - add peer", func(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithConnectFunc(func(ctx context.Context, addr ma.Multiaddr) (*bzz.Address, error) { if addr.String() == errorUnderlay { return nil, testErr @@ -109,7 +107,6 @@ func TestDisconnect(t *testing.T) { testErr := errors.New("test error") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithDisconnectFunc(func(addr swarm.Address, reason string) error { if reason != "user requested disconnect" { return testErr @@ -166,7 +163,6 @@ func TestPeer(t *testing.T) { overlay := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59c") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithPeersFunc(func() []p2p.Peer { return []p2p.Peer{{Address: overlay}} })), @@ -188,7 +184,6 @@ func TestBlocklistedPeers(t *testing.T) { overlay := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59c") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithBlocklistedPeersFunc(func() ([]p2p.BlockListedPeer, error) { return []p2p.BlockListedPeer{{Peer: p2p.Peer{Address: overlay}}}, nil })), @@ -206,7 +201,6 @@ func TestBlocklistedPeersErr(t *testing.T) { overlay := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59c") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithBlocklistedPeersFunc(func() ([]p2p.BlockListedPeer, error) { return []p2p.BlockListedPeer{{Peer: p2p.Peer{Address: overlay}}}, errors.New("some error") })), @@ -224,7 +218,7 @@ func TestBlocklistedPeersErr(t *testing.T) { func Test_peerConnectHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -260,7 +254,7 @@ func Test_peerConnectHandler_invalidInputs(t *testing.T) { func Test_peerDisconnectHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/pingpong_test.go b/pkg/api/pingpong_test.go index 4dffae5b0e6..9de99103619 100644 --- a/pkg/api/pingpong_test.go +++ b/pkg/api/pingpong_test.go @@ -39,7 +39,6 @@ func TestPingpong(t *testing.T) { }) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, Pingpong: pingpongService, }) @@ -79,7 +78,7 @@ func TestPingpong(t *testing.T) { func Test_pingpongHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/postage_test.go b/pkg/api/postage_test.go index ebf808c1c7a..13e3dda13d6 100644 --- a/pkg/api/postage_test.go +++ b/pkg/api/postage_test.go @@ -65,7 +65,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -90,7 +89,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -111,7 +109,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -132,7 +129,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -161,7 +157,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -182,7 +177,6 @@ func TestPostageCreateStamp(t *testing.T) { t.Parallel() ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SyncStatus: func() (bool, error) { return false, nil }, }) @@ -197,7 +191,6 @@ func TestPostageCreateStamp(t *testing.T) { t.Parallel() ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SyncStatus: func() (bool, error) { return true, errors.New("oops") }, }) @@ -223,7 +216,7 @@ func TestPostageGetStamps(t *testing.T) { t.Parallel() bs := mock.New(mock.WithChainState(cs), mock.WithBatch(b)) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) jsonhttptest.Request(t, ts, http.MethodGet, "/stamps", http.StatusOK, jsonhttptest.WithExpectedJSONResponse(&api.PostageStampsResponse{ @@ -259,7 +252,7 @@ func TestPostageGetStamps(t *testing.T) { } ecs := &postage.ChainState{Block: 10, TotalAmount: big.NewInt(15), CurrentPrice: big.NewInt(12)} ebs := mock.New(mock.WithChainState(ecs)) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, Post: emp, BatchStore: ebs, BlockTime: 2 * time.Second}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: emp, BatchStore: ebs, BlockTime: 2 * time.Second}) jsonhttptest.Request(t, ts, http.MethodGet, "/stamps/"+hex.EncodeToString(eb.ID), http.StatusNotFound, jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{ @@ -281,7 +274,7 @@ func TestGetAllBatches(t *testing.T) { mp := mockpost.New(mockpost.WithIssuer(si)) cs := &postage.ChainState{Block: 10, TotalAmount: big.NewInt(5), CurrentPrice: big.NewInt(2)} bs := mock.New(mock.WithChainState(cs), mock.WithBatch(b)) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) oneBatch := struct { Batches []api.PostageBatchResponse `json:"batches"` @@ -318,7 +311,7 @@ func TestPostageGetStamp(t *testing.T) { mp := mockpost.New(mockpost.WithIssuer(si)) cs := &postage.ChainState{Block: 10, TotalAmount: big.NewInt(5), CurrentPrice: big.NewInt(2)} bs := mock.New(mock.WithChainState(cs), mock.WithBatch(b)) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) t.Run("ok", func(t *testing.T) { t.Parallel() @@ -346,7 +339,7 @@ func TestPostageGetBuckets(t *testing.T) { si := postage.NewStampIssuer("", "", batchOk, big.NewInt(3), 11, 10, 1000, true) mp := mockpost.New(mockpost.WithIssuer(si)) - ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp, DebugAPI: true}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp}) buckets := make([]api.BucketData, 1024) for i := range buckets { buckets[i] = api.BucketData{BucketID: uint32(i)} @@ -369,7 +362,7 @@ func TestPostageGetBuckets(t *testing.T) { t.Parallel() mpNotFound := mockpost.New() - tsNotFound, _, _, _ := newTestServer(t, testServerOptions{Post: mpNotFound, DebugAPI: true}) + tsNotFound, _, _, _ := newTestServer(t, testServerOptions{Post: mpNotFound}) jsonhttptest.Request(t, tsNotFound, http.MethodGet, "/stamps/"+batchOkStr+"/buckets", http.StatusNotFound) }) @@ -383,7 +376,6 @@ func TestReserveState(t *testing.T) { t.Parallel() ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BatchStore: mock.New(mock.WithRadius(5)), Storer: mockstorer.New(), }) @@ -397,7 +389,6 @@ func TestReserveState(t *testing.T) { t.Parallel() ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BatchStore: mock.New(), Storer: mockstorer.New(), }) @@ -418,7 +409,6 @@ func TestChainState(t *testing.T) { CurrentPrice: big.NewInt(5), } ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BatchStore: mock.New(mock.WithChainState(cs)), BackendOpts: []backendmock.Option{backendmock.WithBlockNumberFunc(func(ctx context.Context) (uint64, error) { return 1, nil @@ -460,7 +450,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -490,7 +479,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -512,7 +500,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -533,7 +520,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -557,7 +543,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -595,7 +580,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -625,7 +609,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -647,7 +630,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -668,7 +650,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -692,7 +673,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -812,7 +792,6 @@ func TestPostageAccessHandler(t *testing.T) { ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -837,7 +816,7 @@ func TestPostageAccessHandler(t *testing.T) { func Test_postageCreateHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -887,7 +866,7 @@ func Test_postageCreateHandler_invalidInputs(t *testing.T) { func Test_postageGetStampBucketsHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -949,7 +928,7 @@ func Test_postageGetStampBucketsHandler_invalidInputs(t *testing.T) { func Test_postageGetStampHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -1012,7 +991,7 @@ func Test_postageGetStampHandler_invalidInputs(t *testing.T) { func Test_postageTopUpHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -1091,7 +1070,7 @@ func Test_postageTopUpHandler_invalidInputs(t *testing.T) { func Test_postageDiluteHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/redistribution_test.go b/pkg/api/redistribution_test.go index 88bf00abe51..07b4bc28cfe 100644 --- a/pkg/api/redistribution_test.go +++ b/pkg/api/redistribution_test.go @@ -36,7 +36,6 @@ func TestRedistributionStatus(t *testing.T) { t.Errorf("redistribution put state: %v", err) } srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, StateStorer: store, TransactionOpts: []mock.Option{ mock.WithTransactionFeeFunc(func(ctx context.Context, txHash common.Hash) (*big.Int, error) { @@ -61,7 +60,6 @@ func TestRedistributionStatus(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BeeMode: api.LightMode, StateStorer: statestore.NewStateStore(), TransactionOpts: []mock.Option{ diff --git a/pkg/api/settlements_test.go b/pkg/api/settlements_test.go index 86f2e2e42e1..f76997e1b8c 100644 --- a/pkg/api/settlements_test.go +++ b/pkg/api/settlements_test.go @@ -39,7 +39,6 @@ func TestSettlements(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{mock.WithSettlementsSentFunc(settlementsSentFunc), mock.WithSettlementsRecvFunc(settlementsRecvFunc)}, }) @@ -90,7 +89,6 @@ func TestSettlementsError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{mock.WithSettlementsSentFunc(settlementsSentFunc)}, }) @@ -110,7 +108,6 @@ func TestSettlementsPeers(t *testing.T) { return big.NewInt(1000000000000000000), nil } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{mock.WithSettlementSentFunc(settlementSentFunc)}, }) @@ -138,7 +135,6 @@ func TestSettlementsPeersNoSettlements(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{ mock.WithSettlementSentFunc(errFunc), mock.WithSettlementRecvFunc(noErrFunc), @@ -158,7 +154,6 @@ func TestSettlementsPeersNoSettlements(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{ mock.WithSettlementSentFunc(noErrFunc), mock.WithSettlementRecvFunc(errFunc), @@ -178,7 +173,7 @@ func TestSettlementsPeersNoSettlements(t *testing.T) { func Test_peerSettlementsHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -233,7 +228,6 @@ func TestSettlementsPeersError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{mock.WithSettlementSentFunc(settlementSentFunc)}, }) diff --git a/pkg/api/staking_test.go b/pkg/api/staking_test.go index e6f4d0b2296..0d6dac27587 100644 --- a/pkg/api/staking_test.go +++ b/pkg/api/staking_test.go @@ -39,7 +39,7 @@ func TestDepositStake(t *testing.T) { return txHash, nil }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodPost, depositStake(minStake), http.StatusOK) }) @@ -52,7 +52,7 @@ func TestDepositStake(t *testing.T) { return common.Hash{}, staking.ErrInsufficientStakeAmount }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodPost, depositStake(invalidMinStake), http.StatusBadRequest, jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusBadRequest, Message: "insufficient stake amount"})) }) @@ -65,7 +65,7 @@ func TestDepositStake(t *testing.T) { return common.Hash{}, staking.ErrInsufficientFunds }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodPost, depositStake(minStake), http.StatusBadRequest) jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusBadRequest, Message: "out of funds"}) }) @@ -78,7 +78,7 @@ func TestDepositStake(t *testing.T) { return common.Hash{}, fmt.Errorf("some error") }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodPost, depositStake(minStake), http.StatusInternalServerError) jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusInternalServerError, Message: "cannot stake"}) }) @@ -96,7 +96,6 @@ func TestDepositStake(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, StakingContract: contract, }) @@ -117,7 +116,7 @@ func TestGetStake(t *testing.T) { return big.NewInt(1), nil }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodGet, "/stake", http.StatusOK, jsonhttptest.WithExpectedJSONResponse(&api.GetStakeResponse{StakedAmount: bigint.Wrap(big.NewInt(1))})) }) @@ -130,7 +129,7 @@ func TestGetStake(t *testing.T) { return big.NewInt(0), fmt.Errorf("get stake failed") }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contractWithError}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contractWithError}) jsonhttptest.Request(t, ts, http.MethodGet, "/stake", http.StatusInternalServerError, jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusInternalServerError, Message: "get staked amount failed"})) }) @@ -139,7 +138,7 @@ func TestGetStake(t *testing.T) { func Test_stakingDepositHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -185,7 +184,7 @@ func TestWithdrawAllStake(t *testing.T) { return txHash, nil }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodDelete, "/stake", http.StatusOK, jsonhttptest.WithExpectedJSONResponse( &api.WithdrawAllStakeResponse{TxHash: txHash.String()})) }) @@ -198,7 +197,7 @@ func TestWithdrawAllStake(t *testing.T) { return common.Hash{}, staking.ErrInsufficientStake }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodDelete, "/stake", http.StatusBadRequest, jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusBadRequest, Message: "insufficient stake to withdraw"})) }) @@ -211,7 +210,7 @@ func TestWithdrawAllStake(t *testing.T) { return common.Hash{}, fmt.Errorf("some error") }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodDelete, "/stake", http.StatusInternalServerError) jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusInternalServerError, Message: "cannot withdraw stake"}) }) @@ -229,7 +228,6 @@ func TestWithdrawAllStake(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, StakingContract: contract, }) diff --git a/pkg/api/status_test.go b/pkg/api/status_test.go index cc2c568abf4..8dadff7484c 100644 --- a/pkg/api/status_test.go +++ b/pkg/api/status_test.go @@ -58,7 +58,6 @@ func TestGetStatus(t *testing.T) { client, _, _, _ := newTestServer(t, testServerOptions{ BeeMode: mode, - DebugAPI: true, NodeStatus: statusSvc, }) @@ -71,8 +70,7 @@ func TestGetStatus(t *testing.T) { t.Parallel() client, _, _, _ := newTestServer(t, testServerOptions{ - BeeMode: api.DevMode, - DebugAPI: true, + BeeMode: api.DevMode, NodeStatus: status.NewService( log.Noop, nil, diff --git a/pkg/api/topology_test.go b/pkg/api/topology_test.go index ebd22532f3b..11dd6703791 100644 --- a/pkg/api/topology_test.go +++ b/pkg/api/topology_test.go @@ -14,7 +14,7 @@ import ( func TestTopologyOK(t *testing.T) { t.Parallel() - testServer, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + testServer, _, _, _ := newTestServer(t, testServerOptions{}) var body []byte opts := jsonhttptest.WithPutResponseBody(&body) diff --git a/pkg/api/transaction_test.go b/pkg/api/transaction_test.go index 46e066c4091..c23cc9cf3f5 100644 --- a/pkg/api/transaction_test.go +++ b/pkg/api/transaction_test.go @@ -42,7 +42,6 @@ func TestTransactionStoredTransaction(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithStoredTransactionFunc(func(txHash common.Hash) (*transaction.StoredTransaction, error) { return &transaction.StoredTransaction{ @@ -84,7 +83,6 @@ func TestTransactionStoredTransaction(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithStoredTransactionFunc(func(txHash common.Hash) (*transaction.StoredTransaction, error) { return nil, transaction.ErrUnknownTransaction @@ -103,7 +101,6 @@ func TestTransactionStoredTransaction(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithStoredTransactionFunc(func(txHash common.Hash) (*transaction.StoredTransaction, error) { return nil, errors.New("err") @@ -155,7 +152,6 @@ func TestTransactionList(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithPendingTransactionsFunc(func() ([]common.Hash, error) { return []common.Hash{txHash1, txHash2}, nil @@ -210,7 +206,6 @@ func TestTransactionListError(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithPendingTransactionsFunc(func() ([]common.Hash, error) { return nil, errors.New("err") @@ -233,7 +228,6 @@ func TestTransactionListError(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithPendingTransactionsFunc(func() ([]common.Hash, error) { return []common.Hash{txHash1}, nil @@ -261,7 +255,6 @@ func TestTransactionResend(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { return nil @@ -280,7 +273,6 @@ func TestTransactionResend(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { return transaction.ErrUnknownTransaction @@ -300,7 +292,6 @@ func TestTransactionResend(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { return transaction.ErrAlreadyImported @@ -320,7 +311,6 @@ func TestTransactionResend(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { return errors.New("err") diff --git a/pkg/api/wallet_test.go b/pkg/api/wallet_test.go index c6f7449d51a..d5c09efaeeb 100644 --- a/pkg/api/wallet_test.go +++ b/pkg/api/wallet_test.go @@ -28,7 +28,6 @@ func TestWallet(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { return big.NewInt(10000000000000000), nil @@ -54,7 +53,6 @@ func TestWallet(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BackendOpts: []backendmock.Option{ backendmock.WithBalanceAt(func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) { return new(big.Int), nil @@ -73,7 +71,6 @@ func TestWallet(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { return new(big.Int), nil @@ -95,7 +92,7 @@ func TestWalletWithdraw(t *testing.T) { t.Run("address not whitelisted", func(t *testing.T) { t.Parallel() - srv, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + srv, _, _, _ := newTestServer(t, testServerOptions{}) jsonhttptest.Request(t, srv, http.MethodPost, "/wallet/withdraw/BZZ?address=0xaf&amount=99999999", http.StatusBadRequest, jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ @@ -107,7 +104,7 @@ func TestWalletWithdraw(t *testing.T) { t.Run("invalid coin type", func(t *testing.T) { t.Parallel() - srv, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + srv, _, _, _ := newTestServer(t, testServerOptions{}) jsonhttptest.Request(t, srv, http.MethodPost, "/wallet/withdraw/BTC?address=0xaf&amount=99999999", http.StatusBadRequest, jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ @@ -120,7 +117,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", }) @@ -135,7 +131,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { @@ -155,7 +150,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { @@ -177,7 +171,6 @@ func TestWalletWithdraw(t *testing.T) { txHash := common.HexToHash("0x00f") srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { @@ -205,7 +198,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", }) @@ -220,7 +212,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", BackendOpts: []backendmock.Option{ backendmock.WithBalanceAt(func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) { @@ -240,7 +231,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", BackendOpts: []backendmock.Option{ backendmock.WithBalanceAt(func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) { @@ -262,7 +252,6 @@ func TestWalletWithdraw(t *testing.T) { txHash := common.HexToHash("0x00f") srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", BackendOpts: []backendmock.Option{ backendmock.WithBalanceAt(func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) { diff --git a/pkg/api/welcome_message_test.go b/pkg/api/welcome_message_test.go index 39d7c19a039..6eb6670e8ab 100644 --- a/pkg/api/welcome_message_test.go +++ b/pkg/api/welcome_message_test.go @@ -23,7 +23,6 @@ func TestGetWelcomeMessage(t *testing.T) { const DefaultTestWelcomeMessage = "Hello World!" srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithGetWelcomeMessageFunc(func() string { return DefaultTestWelcomeMessage }))}) @@ -75,8 +74,7 @@ func TestSetWelcomeMessage(t *testing.T) { mockP2P := mock.New() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, - P2P: mockP2P, + P2P: mockP2P, }) if tC.wantMessage == "" { @@ -112,7 +110,6 @@ func TestSetWelcomeMessageInternalServerError(t *testing.T) { testURL := "/welcome-message" srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithSetWelcomeMessageFunc(func(string) error { return testError })),