fix: Remove deprecated length field
This commit is contained in:
committed by
Michael Vines
parent
efd0392706
commit
f2b38bcc56
@ -464,14 +464,8 @@ export class Connection {
|
|||||||
async sendRawTransaction(
|
async sendRawTransaction(
|
||||||
rawTransaction: Buffer,
|
rawTransaction: Buffer,
|
||||||
): Promise<TransactionSignature> {
|
): 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', [
|
const unsafeRes = await this._rpcRequest('sendTransaction', [
|
||||||
[...rpcTransaction],
|
[...rawTransaction],
|
||||||
]);
|
]);
|
||||||
const res = SendTransactionRpcResult(unsafeRes);
|
const res = SendTransactionRpcResult(unsafeRes);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
|
Reference in New Issue
Block a user