assertIsSuccessfulTransactionPlanResult
Asserts that the given transaction plan result is a SuccessfulTransactionPlanResult.
This function verifies that the entire transaction plan result tree contains only successful single transaction results. It throws if any SingleTransactionPlanResult in the tree has a 'failed' or 'canceled' status.
Note: This is different from assertIsSuccessfulSingleTransactionPlanResult which asserts that a single result is successful. This function asserts that the entire plan result tree (including all nested parallel/sequential structures) contains only successful transactions.
Type Parameters
| Type Parameter | Default type |
|---|---|
TContext extends TransactionPlanResultContext | TransactionPlanResultContext |
TTransactionMessage extends TransactionMessage & TransactionMessageWithFeePayer<string> | TransactionMessage & TransactionMessageWithFeePayer<string> |
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | TransactionPlanResult<TContext, TTransactionMessage> | The transaction plan result to assert. |
Returns
asserts plan is SuccessfulTransactionPlanResult<TContext, TTransactionMessage>
Throws
Throws a SolanaError with code
SOLANA_ERROR__INSTRUCTION_PLANS__EXPECTED_SUCCESSFUL_TRANSACTION_PLAN_RESULT if
any single transaction result in the tree is not successful.