rpc/server: fix test block encoding

The end result of the previous code wasn't even a valid JSON.
This commit is contained in:
Roman Khimov 2020-05-04 16:53:36 +03:00
parent d275652b37
commit 8cec6694ae

View file

@ -849,7 +849,7 @@ func TestRPC(t *testing.T) {
rpc := `{"jsonrpc": "2.0", "id": 1, "method": "submitblock", "params": ["%s"]}`
t.Run("empty", func(t *testing.T) {
s := newBlock(t, chain, 1)
body := doRPCCall(fmt.Sprintf(rpc, s), httpSrv.URL, t)
body := doRPCCall(fmt.Sprintf(rpc, encodeBlock(t, s)), httpSrv.URL, t)
checkErrGetResult(t, body, true)
})