fix: Remove deprecated length field

This commit is contained in:
Tyera Eulberg 2019-04-10 12:33:42 -07:00 committed by Michael Vines
parent efd0392706
commit f2b38bcc56
1 changed files with 1 additions and 7 deletions

View File

@ -464,14 +464,8 @@ export class Connection {
async sendRawTransaction(
rawTransaction: Buffer,
): Promise<TransactionSignature> {
// sendTransaction RPC API requires a u64 length field prepended to the raw
// Transaction bytes
const rpcTransaction = Buffer.alloc(8 + rawTransaction.length);
rpcTransaction.writeUInt32LE(rawTransaction.length, 0);
rawTransaction.copy(rpcTransaction, 8);
const unsafeRes = await this._rpcRequest('sendTransaction', [
[...rpcTransaction],
[...rawTransaction],
]);
const res = SendTransactionRpcResult(unsafeRes);
if (res.error) {