@@ -55,7 +55,10 @@ import {
55
55
} from "@pythnetwork/pyth-solana-receiver" ;
56
56
57
57
import { LedgerNodeWallet } from "./ledger" ;
58
- import { DEFAULT_PRIORITY_FEE_CONFIG } from "@pythnetwork/solana-utils" ;
58
+ import {
59
+ DEFAULT_PRIORITY_FEE_CONFIG ,
60
+ TransactionBuilder ,
61
+ } from "@pythnetwork/solana-utils" ;
59
62
60
63
export async function loadHotWalletOrLedger (
61
64
wallet : string ,
@@ -623,7 +626,10 @@ multisigCommand("init-price-store-buffers", "Init price store buffers").action(
623
626
const allPythAccounts = await connection . getProgramAccounts (
624
627
oracleProgramId
625
628
) ;
626
- const allPublishers : Set < PublicKey > = new Set ( ) ;
629
+
630
+ // Storing them as string to make sure equal comparison works (for the Set)
631
+ const allPublishers : Set < string > = new Set ( ) ;
632
+
627
633
for ( const account of allPythAccounts ) {
628
634
const data = account . account . data ;
629
635
const base = parseBaseData ( data ) ;
@@ -633,13 +639,14 @@ multisigCommand("init-price-store-buffers", "Init price store buffers").action(
633
639
0 ,
634
640
parsed . numComponentPrices
635
641
) ) {
636
- allPublishers . add ( component . publisher ) ;
642
+ allPublishers . add ( component . publisher . toBase58 ( ) ) ;
637
643
}
638
644
}
639
645
}
640
646
641
647
let instructions = [ ] ;
642
- for ( const publisherKey of allPublishers ) {
648
+ for ( const publisherKeyBase58 of allPublishers ) {
649
+ const publisherKey = new PublicKey ( publisherKeyBase58 ) ;
643
650
if ( await isPriceStorePublisherInitialized ( connection , publisherKey ) ) {
644
651
// Already configured.
645
652
continue ;
@@ -703,7 +710,14 @@ multisigCommand("approve", "Approve a transaction sitting in the multisig")
703
710
. action ( async ( options : any ) => {
704
711
const vault = await loadVaultFromOptions ( options ) ;
705
712
const transaction : PublicKey = new PublicKey ( options . transaction ) ;
706
- await vault . squad . approveTransaction ( transaction ) ;
713
+ const instruction = await vault . approveProposalIx ( transaction ) ;
714
+
715
+ const txToSend = TransactionBuilder . batchIntoLegacyTransactions (
716
+ [ instruction ] ,
717
+ DEFAULT_PRIORITY_FEE_CONFIG
718
+ ) ;
719
+
720
+ await vault . sendAllTransactions ( txToSend ) ;
707
721
} ) ;
708
722
709
723
multisigCommand ( "propose-token-transfer" , "Propose token transfer" )
@@ -801,7 +815,14 @@ multisigCommand("activate", "Activate a transaction sitting in the multisig")
801
815
. action ( async ( options : any ) => {
802
816
const vault = await loadVaultFromOptions ( options ) ;
803
817
const transaction : PublicKey = new PublicKey ( options . transaction ) ;
804
- await vault . squad . activateTransaction ( transaction ) ;
818
+ const instruction = await vault . activateProposalIx ( transaction ) ;
819
+
820
+ const txToSend = TransactionBuilder . batchIntoLegacyTransactions (
821
+ [ instruction ] ,
822
+ DEFAULT_PRIORITY_FEE_CONFIG
823
+ ) ;
824
+
825
+ await vault . sendAllTransactions ( txToSend ) ;
805
826
} ) ;
806
827
807
828
multisigCommand ( "add-and-delete" , "Change the roster of the multisig" )
0 commit comments