File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
governance/xc_admin/packages/xc_admin_common/src Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { ExecutePostedVaa } from "./governance_payload/ExecutePostedVaa";
20
20
import { OPS_KEY } from "./multisig" ;
21
21
22
22
export const MAX_EXECUTOR_PAYLOAD_SIZE = PACKET_DATA_SIZE - 687 ; // Bigger payloads won't fit in one addInstruction call when adding to the proposal
23
+ export const SIZE_OF_SIGNED_BATCH = 30 ;
23
24
24
25
type SquadInstruction = {
25
26
instruction : TransactionInstruction ;
@@ -111,15 +112,18 @@ export async function proposeInstructions(
111
112
ixToSend . push ( await squad . buildApproveTransaction ( vault , newProposalAddress ) ) ;
112
113
113
114
const txToSend = batchIntoTransactions ( ixToSend ) ;
114
- await new AnchorProvider (
115
- squad . connection ,
116
- squad . wallet ,
117
- AnchorProvider . defaultOptions ( )
118
- ) . sendAll (
119
- txToSend . map ( ( tx ) => {
120
- return { tx, signers : [ ] } ;
121
- } )
122
- ) ;
115
+
116
+ for ( let i = 0 ; i < txToSend . length ; i += SIZE_OF_SIGNED_BATCH ) {
117
+ await new AnchorProvider (
118
+ squad . connection ,
119
+ squad . wallet ,
120
+ AnchorProvider . defaultOptions ( )
121
+ ) . sendAll (
122
+ txToSend . slice ( i , i + SIZE_OF_SIGNED_BATCH ) . map ( ( tx ) => {
123
+ return { tx, signers : [ ] } ;
124
+ } )
125
+ ) ;
126
+ }
123
127
return newProposalAddress ;
124
128
}
125
129
You can’t perform that action at this time.
0 commit comments