rpc: return bse64 bytes from getblock, getblockheader, getrawtx

Close #1522
This commit is contained in:
Anna Shaleva 2020-11-06 17:37:58 +03:00
parent bdd073aad7
commit 6bb81d9b51
4 changed files with 22 additions and 33 deletions

View file

@ -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.