Merge pull request #3261 from nspcc-dev/fix-client-init-test

rpcclient: fix failing initialisation-based tests
This commit is contained in:
Roman Khimov 2023-12-11 13:11:10 +03:00 committed by GitHub
commit a5a87a72c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,6 +34,7 @@ func TestWSClientClose(t *testing.T) {
srv := initTestServer(t, `{"jsonrpc": "2.0", "id": 1, "result": "55aaff00"}`) srv := initTestServer(t, `{"jsonrpc": "2.0", "id": 1, "result": "55aaff00"}`)
wsc, err := NewWS(context.TODO(), httpURLtoWS(srv.URL), WSOptions{}) wsc, err := NewWS(context.TODO(), httpURLtoWS(srv.URL), WSOptions{})
require.NoError(t, err) require.NoError(t, err)
wsc.cache.initDone = true
wsc.getNextRequestID = getTestRequestID wsc.getNextRequestID = getTestRequestID
bCh := make(chan *block.Block) bCh := make(chan *block.Block)
_, err = wsc.ReceiveBlocks(nil, bCh) _, err = wsc.ReceiveBlocks(nil, bCh)
@ -666,6 +667,7 @@ func TestWSFilteredSubscriptions(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
wsc.getNextRequestID = getTestRequestID wsc.getNextRequestID = getTestRequestID
wsc.cache.network = netmode.UnitTestNet wsc.cache.network = netmode.UnitTestNet
wsc.cache.initDone = true
c.clientCode(t, wsc) c.clientCode(t, wsc)
wsc.Close() wsc.Close()
}) })