Skip to content

Commit

Permalink
ts: Fix incorrect maxSupportedTransactionVersion in `AnchorProvider…
Browse files Browse the repository at this point in the history
….send*()` methods (#2922)
  • Loading branch information
czkz authored Apr 23, 2024
1 parent 10c9975 commit c96846f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The minor version will be incremented upon a breaking change and the patch versi
### Fixes

- lang: Eliminate variable allocations that build up stack space for token extension code generation ([#2913](https://github.com/coral-xyz/anchor/pull/2913)).
- ts: Fix incorrect `maxSupportedTransactionVersion` in `AnchorProvider.send*()` methods ([#2922](https://github.com/coral-xyz/anchor/pull/2922)).

### Breaking

Expand Down
4 changes: 4 additions & 0 deletions ts/packages/anchor/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ export class AnchorProvider implements Provider {
? tx.signatures?.[0] || new Uint8Array()
: tx.signature ?? new Uint8Array()
);
const maxVer = isVersionedTransaction(tx) ? 0 : undefined;
const failedTx = await this.connection.getTransaction(txSig, {
commitment: "confirmed",
maxSupportedTransactionVersion: maxVer,
});
if (!failedTx) {
throw err;
Expand Down Expand Up @@ -256,8 +258,10 @@ export class AnchorProvider implements Provider {
? tx.signatures?.[0] || new Uint8Array()
: tx.signature ?? new Uint8Array()
);
const maxVer = isVersionedTransaction(tx) ? 0 : undefined;
const failedTx = await this.connection.getTransaction(txSig, {
commitment: "confirmed",
maxSupportedTransactionVersion: maxVer,
});
if (!failedTx) {
throw err;
Expand Down

0 comments on commit c96846f

Please sign in to comment.