rpc: adjust submitblock
RPC-call
It should return block hash instead of boolean.
This commit is contained in:
parent
c2534b1a0b
commit
889a5d7eb6
4 changed files with 22 additions and 20 deletions
|
@ -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)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue