action_layer_driver/
error.rs

1//! Error types for action-layer-driver
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum DriverError {
7    #[error("Failed to parse puzzle bytes: {0}")]
8    PuzzleParse(String),
9
10    #[error("Failed to load puzzle into context: {0}")]
11    PuzzleLoad(String),
12
13    #[error("Failed to allocate CLVM node: {0}")]
14    Alloc(String),
15
16    #[error("Failed to serialize: {0}")]
17    Serialize(String),
18
19    #[error("Failed to construct action layer: {0}")]
20    ActionLayer(String),
21
22    #[error("Merkle proof not found for action hash")]
23    MerkleProofNotFound,
24
25    #[error("Invalid action index: {index}, only {count} actions available")]
26    InvalidActionIndex { index: usize, count: usize },
27
28    #[error("Launcher error: {0}")]
29    Launcher(String),
30
31    #[error("Singleton not yet launched")]
32    NotLaunched,
33
34    #[error("Singleton already launched")]
35    AlreadyLaunched,
36
37    #[error("Singleton has been melted (destroyed)")]
38    Melted,
39
40    #[error("Action failed: {0}")]
41    ActionFailed(String),
42
43    #[error("Broadcast failed: {0}")]
44    Broadcast(String),
45
46    #[error("Confirmation timeout")]
47    ConfirmationTimeout,
48
49    #[error("Network error: {0}")]
50    Network(String),
51}