@@ -15,6 +15,7 @@ import {
15
15
TransactionInstruction ,
16
16
} from "@solana/web3.js" ;
17
17
import Squads from "@sqds/mesh" ;
18
+ import { getIxAuthorityPDA } from "@sqds/mesh" ;
18
19
import bs58 from "bs58" ;
19
20
import { program } from "commander" ;
20
21
import * as fs from "fs" ;
@@ -99,7 +100,9 @@ program
99
100
options . ledgerDerivationChange ,
100
101
options . wallet
101
102
) ;
102
- const msAccount = await squad . getMultisig ( new PublicKey ( options . vaultAddress ) ) ;
103
+ const msAccount = await squad . getMultisig (
104
+ new PublicKey ( options . vaultAddress )
105
+ ) ;
103
106
104
107
const vaultAuthority = squad . getAuthorityPDA (
105
108
msAccount . publicKey ,
@@ -113,12 +116,14 @@ program
113
116
) ;
114
117
115
118
let isActive = undefined ;
116
- if ( options . isActive === ' true' ) {
119
+ if ( options . isActive === " true" ) {
117
120
isActive = true ;
118
- } else if ( options . isActive === ' false' ) {
121
+ } else if ( options . isActive === " false" ) {
119
122
isActive = false ;
120
123
} else {
121
- throw new Error ( `Illegal argument for --is-active. Expected "true" or "false", got "${ options . isActive } "` )
124
+ throw new Error (
125
+ `Illegal argument for --is-active. Expected "true" or "false", got "${ options . isActive } "`
126
+ ) ;
122
127
}
123
128
124
129
const squadIxs : SquadInstruction [ ] = [
@@ -369,22 +374,6 @@ async function getWormholeMessageIx(
369
374
] ;
370
375
}
371
376
372
- const getIxAuthority = async (
373
- txPda : anchor . web3 . PublicKey ,
374
- index : anchor . BN ,
375
- programId : anchor . web3 . PublicKey
376
- ) => {
377
- return anchor . web3 . PublicKey . findProgramAddress (
378
- [
379
- anchor . utils . bytes . utf8 . encode ( "squad" ) ,
380
- txPda . toBuffer ( ) ,
381
- index . toArrayLike ( Buffer , "le" , 4 ) ,
382
- anchor . utils . bytes . utf8 . encode ( "ix_authority" ) ,
383
- ] ,
384
- programId
385
- ) ;
386
- } ;
387
-
388
377
async function createWormholeMsgMultisigTx (
389
378
cluster : Cluster ,
390
379
squad : Squads ,
@@ -401,7 +390,7 @@ async function createWormholeMsgMultisigTx(
401
390
402
391
const txKey = await createTx ( squad , ledger , vault ) ;
403
392
404
- const [ messagePDA , messagePdaBump ] = await getIxAuthority (
393
+ const [ messagePDA , messagePdaBump ] = getIxAuthorityPDA (
405
394
txKey ,
406
395
new anchor . BN ( 1 ) ,
407
396
squad . multisigProgramId
0 commit comments