Skip to content

Commit

Permalink
feat: agave v2 rpc: replace getConfirmedTransaction with `getTransa…
Browse files Browse the repository at this point in the history
…ction` (#3418)
  • Loading branch information
buffalojoec authored Dec 16, 2024
1 parent 60e39a6 commit a805cb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit a805cb9

Please sign in to comment.