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`
  • Loading branch information
buffalojoec committed Oct 29, 2024
1 parent 6acd1dc commit ee67085
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 @@ -5351,7 +5351,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 @@ -5382,7 +5382,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 @@ -5409,7 +5409,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 ee67085

Please sign in to comment.