Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

feat: Agave v2 RPC: replace getConfirmedTransaction with getTransaction #3418

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5353,7 +5353,7 @@ export class Connection {
commitment?: Finality,
): Promise<ConfirmedTransaction | null> {
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');
Expand Down Expand Up @@ -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(
Expand All @@ -5411,7 +5411,7 @@ export class Connection {
'jsonParsed',
);
return {
methodName: 'getConfirmedTransaction',
methodName: 'getTransaction',
args,
};
});
Expand Down
10 changes: 5 additions & 5 deletions test/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2712,7 +2712,7 @@ describe('Connection', function () {
await mockRpcBatchResponse({
batch: [
{
methodName: 'getConfirmedTransaction',
methodName: 'getTransaction',
args: [],
},
],
Expand Down Expand Up @@ -3364,7 +3364,7 @@ describe('Connection', function () {
}

await mockRpcResponse({
method: 'getConfirmedTransaction',
method: 'getTransaction',
params: [confirmedTransaction],
value: {
slot,
Expand Down Expand Up @@ -3430,7 +3430,7 @@ describe('Connection', function () {
});

await mockRpcResponse({
method: 'getConfirmedTransaction',
method: 'getTransaction',
params: [recentSignature],
value: null,
});
Expand Down Expand Up @@ -3622,7 +3622,7 @@ describe('Connection', function () {
}

await mockRpcResponse({
method: 'getConfirmedTransaction',
method: 'getTransaction',
params: [confirmedTransaction, {encoding: 'jsonParsed'}],
value: getMockData({
parsed: {},
Expand All @@ -3641,7 +3641,7 @@ describe('Connection', function () {
}

await mockRpcResponse({
method: 'getConfirmedTransaction',
method: 'getTransaction',
params: [confirmedTransaction, {encoding: 'jsonParsed'}],
value: getMockData({
accounts: [
Expand Down
Loading