rpc: add 0x
prefix to the getbestblockhash answer
For consistency with C# nodes that do add it to their answers.
This commit is contained in:
parent
54bb9b94c7
commit
70e4529848
2 changed files with 2 additions and 2 deletions
|
@ -117,7 +117,7 @@ Methods:
|
||||||
switch req.Method {
|
switch req.Method {
|
||||||
case "getbestblockhash":
|
case "getbestblockhash":
|
||||||
getbestblockhashCalled.Inc()
|
getbestblockhashCalled.Inc()
|
||||||
results = s.chain.CurrentBlockHash().ReverseString()
|
results = "0x" + s.chain.CurrentBlockHash().ReverseString()
|
||||||
|
|
||||||
case "getblock":
|
case "getblock":
|
||||||
getbestblockCalled.Inc()
|
getbestblockCalled.Inc()
|
||||||
|
|
|
@ -28,7 +28,7 @@ func TestRPC(t *testing.T) {
|
||||||
var res StringResultResponse
|
var res StringResultResponse
|
||||||
err := json.Unmarshal(bytes.TrimSpace(body), &res)
|
err := json.Unmarshal(bytes.TrimSpace(body), &res)
|
||||||
assert.NoErrorf(t, err, "could not parse response: %s", body)
|
assert.NoErrorf(t, err, "could not parse response: %s", body)
|
||||||
assert.Equal(t, chain.CurrentBlockHash().ReverseString(), res.Result)
|
assert.Equal(t, "0x"+chain.CurrentBlockHash().ReverseString(), res.Result)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("getblock", func(t *testing.T) {
|
t.Run("getblock", func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue