Merge pull request #1525 from nspcc-dev/rpc/base64

rpc: return bse64 bytes from `getblock`, `getblockheader`, `getrawtx`
This commit is contained in:
Roman Khimov 2020-11-09 10:48:28 +03:00 committed by GitHub
commit a9dddf893a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 33 deletions

View file

@ -458,7 +458,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) {
@ -858,7 +858,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
@ -941,7 +941,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.