ExecutionOutcome
Structure
Definition
ExecutionOutcome is the result of execution of Transaction or Receipt
Transaction's ExecutionOutcome
In the result of the Transaction execution will always be a Receipt.
ExecutionOutcomeWithIdView
- Rust
- TypeScript
pub struct ExecutionOutcomeWithIdView {
pub proof: MerklePath,
pub block_hash: CryptoHash,
pub id: CryptoHash,
pub outcome: ExecutionOutcomeView,
}
export type ExecutionOutcomeWithReceipt = {
executionOutcome: {
blockHash: string;
id: string;
outcome: {
executorId: string,
gasBurnt: number,
logs: string[],
metadata: {
gasProfile: string | null;
version: number;
};
receiptIds: string[],
status: ExecutionStatus,
tokensBurnt: string
};
proof: ExecutionProof[];
};
receipt: Receipt | null;
};
ExecutionOutcomeView
- Rust
- TypeScript
pub struct ExecutionOutcomeView {
/// Logs from this transaction or receipt.
pub logs: Vec<String>,
/// Receipt IDs generated by this transaction or receipt.
pub receipt_ids: Vec<CryptoHash>,
/// The amount of the gas burnt by the given transaction or receipt.
pub gas_burnt: Gas,
/// The amount of tokens burnt corresponding to the burnt gas amount.
/// This value doesn't always equal to the `gas_burnt` multiplied by the gas price, because
/// the prepaid gas price might be lower than the actual gas price and it creates a deficit.
#[serde(with = "u128_dec_format")]
pub tokens_burnt: Balance,
/// The id of the account on which the execution happens. For transaction this is signer_id,
/// for receipt this is receiver_id.
pub executor_id: AccountId,
/// Execution status. Contains the result in case of successful execution.
pub status: ExecutionStatusView,
/// Execution metadata, versioned
#[serde(default)]
pub metadata: ExecutionMetadataView,
}
ExecutionOutcomeWithIdView TypeScript defines this structure already an nested
ExecutionStatusView
- Rust
- TypeScript
pub enum ExecutionStatusView {
/// The execution is pending or unknown.
Unknown,
/// The execution has failed.
Failure(TxExecutionError),
/// The final action succeeded and returned some value or an empty vec encoded in base64.
SuccessValue(String),
/// The final action of the receipt returned a promise or the signed transaction was converted
/// to a receipt. Contains the receipt_id of the generated receipt.
SuccessReceiptId(CryptoHash),
}
export type ExecutionStatus =
| { Unknown: unknown }
| { Failure: unknown }
| { SuccessValue: string }
| { SuccessReceiptId: string };