[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
This commit is contained in:
parent
ecb0e174d4
commit
b34ec4e882
|
@ -64,6 +64,9 @@ export async function proposeInstructions(
|
||||||
}
|
}
|
||||||
|
|
||||||
const batches = batchIntoExecutorPayload(instructions);
|
const batches = batchIntoExecutorPayload(instructions);
|
||||||
|
if (255 <= batches.length) {
|
||||||
|
throw new Error("A proposal can only support 255 instructions");
|
||||||
|
}
|
||||||
for (const [i, batch] of batches.entries()) {
|
for (const [i, batch] of batches.entries()) {
|
||||||
const squadIx = await wrapAsRemoteInstruction(
|
const squadIx = await wrapAsRemoteInstruction(
|
||||||
squad,
|
squad,
|
||||||
|
@ -86,6 +89,9 @@ export async function proposeInstructions(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (255 <= instructions.length) {
|
||||||
|
throw new Error("A proposal can only support 255 instructions");
|
||||||
|
}
|
||||||
for (let i = 0; i < instructions.length; i++) {
|
for (let i = 0; i < instructions.length; i++) {
|
||||||
ixToSend.push(
|
ixToSend.push(
|
||||||
await squad.buildAddInstruction(
|
await squad.buildAddInstruction(
|
||||||
|
|
Loading…
Reference in New Issue