Skip to content

Commit b34ec4e

Browse files
authored
[xc-admin] error if proposals have more than 255 instructions (#618)
* Make the change * Revert other files * Remove console log * Fix typo * Add new keyword
1 parent ecb0e17 commit b34ec4e

File tree

1 file changed

+6
-0
lines changed
  • governance/xc_admin/packages/xc_admin_common/src

1 file changed

+6
-0
lines changed

governance/xc_admin/packages/xc_admin_common/src/propose.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ export async function proposeInstructions(
6464
}
6565

6666
const batches = batchIntoExecutorPayload(instructions);
67+
if (255 <= batches.length) {
68+
throw new Error("A proposal can only support 255 instructions");
69+
}
6770
for (const [i, batch] of batches.entries()) {
6871
const squadIx = await wrapAsRemoteInstruction(
6972
squad,
@@ -86,6 +89,9 @@ export async function proposeInstructions(
8689
);
8790
}
8891
} else {
92+
if (255 <= instructions.length) {
93+
throw new Error("A proposal can only support 255 instructions");
94+
}
8995
for (let i = 0; i < instructions.length; i++) {
9096
ixToSend.push(
9197
await squad.buildAddInstruction(

0 commit comments

Comments
 (0)