From a805cb929233fa83facfe51749f39961f97ad6a1 Mon Sep 17 00:00:00 2001 From: Joe C Date: Mon, 16 Dec 2024 13:27:20 +0900 Subject: [PATCH] feat: agave v2 rpc: replace `getConfirmedTransaction` with `getTransaction` (#3418) --- src/connection.ts | 6 +++--- test/connection.test.ts | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/connection.ts b/src/connection.ts index 659ae830f78a..70e4091e9a29 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -5353,7 +5353,7 @@ export class Connection { commitment?: Finality, ): Promise { const args = this._buildArgsAtLeastConfirmed([signature], commitment); - const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args); + const unsafeRes = await this._rpcRequest('getTransaction', args); const res = create(unsafeRes, GetTransactionRpcResult); if ('error' in res) { throw new SolanaJSONRPCError(res.error, 'failed to get transaction'); @@ -5384,7 +5384,7 @@ export class Connection { commitment, 'jsonParsed', ); - const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args); + const unsafeRes = await this._rpcRequest('getTransaction', args); const res = create(unsafeRes, GetParsedTransactionRpcResult); if ('error' in res) { throw new SolanaJSONRPCError( @@ -5411,7 +5411,7 @@ export class Connection { 'jsonParsed', ); return { - methodName: 'getConfirmedTransaction', + methodName: 'getTransaction', args, }; }); diff --git a/test/connection.test.ts b/test/connection.test.ts index 563a2805a417..6a8c86b9bbb3 100644 --- a/test/connection.test.ts +++ b/test/connection.test.ts @@ -2712,7 +2712,7 @@ describe('Connection', function () { await mockRpcBatchResponse({ batch: [ { - methodName: 'getConfirmedTransaction', + methodName: 'getTransaction', args: [], }, ], @@ -3364,7 +3364,7 @@ describe('Connection', function () { } await mockRpcResponse({ - method: 'getConfirmedTransaction', + method: 'getTransaction', params: [confirmedTransaction], value: { slot, @@ -3430,7 +3430,7 @@ describe('Connection', function () { }); await mockRpcResponse({ - method: 'getConfirmedTransaction', + method: 'getTransaction', params: [recentSignature], value: null, }); @@ -3622,7 +3622,7 @@ describe('Connection', function () { } await mockRpcResponse({ - method: 'getConfirmedTransaction', + method: 'getTransaction', params: [confirmedTransaction, {encoding: 'jsonParsed'}], value: getMockData({ parsed: {}, @@ -3641,7 +3641,7 @@ describe('Connection', function () { } await mockRpcResponse({ - method: 'getConfirmedTransaction', + method: 'getTransaction', params: [confirmedTransaction, {encoding: 'jsonParsed'}], value: getMockData({ accounts: [