assertIsParallelInstructionPlan

function assertIsParallelInstructionPlan(
    plan,
): asserts plan is Readonly<{
    kind: 'parallel';
    plans: InstructionPlan[];
    planType: 'instructionPlan';
}>;

Asserts that the given instruction plan is a ParallelInstructionPlan.

Parameters

ParameterTypeDescription
planInstructionPlanThe instruction plan to assert.

Returns

asserts plan is Readonly<{ kind: "parallel"; plans: InstructionPlan[]; planType: "instructionPlan" }>

Throws

Throws a SolanaError with code SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_INSTRUCTION_PLAN if the plan is not a parallel instruction plan.

Example

const plan: InstructionPlan = parallelInstructionPlan([instructionA, instructionB]);
 
assertIsParallelInstructionPlan(plan);
console.log(plan.plans.length); // TypeScript knows this is a ParallelInstructionPlan.

See

On this page