Skip to content

Commit fa41302

Browse files
committed
Add placeholder version gate
1 parent 0c644e5 commit fa41302

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

solana/ts/lib/ntt.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,8 @@ export namespace NTT {
11281128
pdas?: Pdas,
11291129
transceiverPdas?: TransceiverPdas
11301130
): Promise<TransactionInstruction> {
1131+
const [major, , ,] = parseVersion(program.idl.version);
1132+
11311133
pdas = pdas ?? NTT.pdas(program.programId);
11321134
transceiverPdas =
11331135
transceiverPdas ?? NTT.transceiverPdas(transceiverProgramId);
@@ -1140,7 +1142,10 @@ export namespace NTT {
11401142
.redeem({})
11411143
.accounts({
11421144
payer: args.payer,
1143-
config: pdas.configAccount(),
1145+
// TODO: bump version to properly gate
1146+
// NOTE: For versions >= 3.x.x, NotPausedConfig is used
1147+
config:
1148+
major >= 3 ? { config: pdas.configAccount() } : pdas.configAccount(),
11441149
peer: pdas.peerAccount(chain),
11451150
transceiverMessage: transceiverPdas.transceiverMessageAccount(
11461151
chain,

0 commit comments

Comments
 (0)