ts: Fix incorrect `maxSupportedTransactionVersion` in `AnchorProvider.send*()` methods (#2922)

This commit is contained in:
czkz 2024-04-23 20:39:18 +04:00 committed by GitHub
parent 10c997552e
commit c96846fce2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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;
@ -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;