From d5dee8fc9457add327ce68c99d0767f04b11ac40 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 11 Dec 2023 12:41:56 +0300 Subject: [PATCH] rpcclient: fix failing initialisation-based tests Must be a part of #3257. Signed-off-by: Anna Shaleva --- pkg/rpcclient/wsclient_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/rpcclient/wsclient_test.go b/pkg/rpcclient/wsclient_test.go index 6b14cbfd5..2555777f8 100644 --- a/pkg/rpcclient/wsclient_test.go +++ b/pkg/rpcclient/wsclient_test.go @@ -34,6 +34,7 @@ func TestWSClientClose(t *testing.T) { srv := initTestServer(t, `{"jsonrpc": "2.0", "id": 1, "result": "55aaff00"}`) wsc, err := NewWS(context.TODO(), httpURLtoWS(srv.URL), WSOptions{}) require.NoError(t, err) + wsc.cache.initDone = true wsc.getNextRequestID = getTestRequestID bCh := make(chan *block.Block) _, err = wsc.ReceiveBlocks(nil, bCh) @@ -666,6 +667,7 @@ func TestWSFilteredSubscriptions(t *testing.T) { require.NoError(t, err) wsc.getNextRequestID = getTestRequestID wsc.cache.network = netmode.UnitTestNet + wsc.cache.initDone = true c.clientCode(t, wsc) wsc.Close() })