rpc: adjust submitblock RPC-call

It should return block hash instead of boolean.
This commit is contained in:
Anna Shaleva 2020-07-21 10:41:18 +03:00
parent c2534b1a0b
commit 889a5d7eb6
4 changed files with 22 additions and 20 deletions

View file

@ -760,9 +760,9 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) []
b := newBlock(t, chain, 1, 0, newTx())
body := doRPCCall(fmt.Sprintf(rpc, encodeBlock(t, b)), httpSrv.URL, t)
data := checkErrGetResult(t, body, false)
var res bool
require.NoError(t, json.Unmarshal(data, &res))
require.True(t, res)
var res = new(result.RelayResult)
require.NoError(t, json.Unmarshal(data, res))
require.Equal(t, b.Hash(), res.Hash)
})
})