rpc: return bse64 bytes from getblock
, getblockheader
, getrawtx
Close #1522
This commit is contained in:
parent
bdd073aad7
commit
6bb81d9b51
4 changed files with 22 additions and 33 deletions
|
@ -444,7 +444,7 @@ func (s *Server) getBlock(reqParams request.Params) (interface{}, *response.Erro
|
|||
}
|
||||
writer := io.NewBufBinWriter()
|
||||
block.EncodeBinary(writer.BinWriter)
|
||||
return hex.EncodeToString(writer.Bytes()), nil
|
||||
return writer.Bytes(), nil
|
||||
}
|
||||
|
||||
func (s *Server) getBlockHash(reqParams request.Params) (interface{}, *response.Error) {
|
||||
|
@ -844,7 +844,7 @@ func (s *Server) getrawtransaction(reqParams request.Params) (interface{}, *resp
|
|||
}
|
||||
results = result.NewTransactionOutputRaw(tx, header, st, s.chain)
|
||||
} else {
|
||||
results = hex.EncodeToString(tx.Bytes())
|
||||
results = tx.Bytes()
|
||||
}
|
||||
|
||||
return results, resultsErr
|
||||
|
@ -927,7 +927,7 @@ func (s *Server) getBlockHeader(reqParams request.Params) (interface{}, *respons
|
|||
if buf.Err != nil {
|
||||
return nil, response.NewInternalServerError("encoding error", buf.Err)
|
||||
}
|
||||
return hex.EncodeToString(buf.Bytes()), nil
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
// getUnclaimedGas returns unclaimed GAS amount of the specified address.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue