@@ -15,6 +15,7 @@ import {
1515 TransactionInstruction ,
1616} from "@solana/web3.js" ;
1717import Squads from "@sqds/mesh" ;
18+ import { getIxAuthorityPDA } from "@sqds/mesh" ;
1819import bs58 from "bs58" ;
1920import { program } from "commander" ;
2021import * as fs from "fs" ;
@@ -99,7 +100,9 @@ program
99100 options . ledgerDerivationChange ,
100101 options . wallet
101102 ) ;
102- const msAccount = await squad . getMultisig ( new PublicKey ( options . vaultAddress ) ) ;
103+ const msAccount = await squad . getMultisig (
104+ new PublicKey ( options . vaultAddress )
105+ ) ;
103106
104107 const vaultAuthority = squad . getAuthorityPDA (
105108 msAccount . publicKey ,
@@ -113,12 +116,14 @@ program
113116 ) ;
114117
115118 let isActive = undefined ;
116- if ( options . isActive === ' true' ) {
119+ if ( options . isActive === " true" ) {
117120 isActive = true ;
118- } else if ( options . isActive === ' false' ) {
121+ } else if ( options . isActive === " false" ) {
119122 isActive = false ;
120123 } 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+ ) ;
122127 }
123128
124129 const squadIxs : SquadInstruction [ ] = [
@@ -369,22 +374,6 @@ async function getWormholeMessageIx(
369374 ] ;
370375}
371376
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-
388377async function createWormholeMsgMultisigTx (
389378 cluster : Cluster ,
390379 squad : Squads ,
@@ -401,7 +390,7 @@ async function createWormholeMsgMultisigTx(
401390
402391 const txKey = await createTx ( squad , ledger , vault ) ;
403392
404- const [ messagePDA , messagePdaBump ] = await getIxAuthority (
393+ const [ messagePDA , messagePdaBump ] = getIxAuthorityPDA (
405394 txKey ,
406395 new anchor . BN ( 1 ) ,
407396 squad . multisigProgramId
0 commit comments