feat(docker): add dev.sh with auto-funding and ATM app setup
- Add dev.sh script for managing regtest development environment - Implement cmd_fund to fund ATM app owner via Lightning.Pub API - Add --fund flag to cmd_up for automatic funding on startup - Update setup_atm_app to write VITE_APP_ID to machine .env - Fix Electron IPC to pass appId and extensionApiUrl to renderer - Restructure repo from nested lamassu-next/ to root The dev.sh script now supports: - ./dev.sh up --fund # Start regtest and auto-fund ATM - ./dev.sh fund # Fund existing ATM app - ./dev.sh status # Show environment status - ./dev.sh reset # Clean restart Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
30a2eb2199
commit
c98f126ba7
180 changed files with 2695 additions and 9587 deletions
91
packages/hal/src/error.rs
Normal file
91
packages/hal/src/error.rs
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
//! Error types for the HAL
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
/// Errors that can occur during bill validator operations
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ValidatorError {
|
||||
/// Failed to connect to the validator
|
||||
#[error("Connection failed: {0}")]
|
||||
ConnectionFailed(String),
|
||||
|
||||
/// Communication error during operation
|
||||
#[error("Communication error: {0}")]
|
||||
CommunicationError(String),
|
||||
|
||||
/// Bill was rejected by the validator
|
||||
#[error("Bill rejected: {0}")]
|
||||
BillRejected(String),
|
||||
|
||||
/// Stacker is full
|
||||
#[error("Stacker full")]
|
||||
StackerFull,
|
||||
|
||||
/// General hardware error
|
||||
#[error("Hardware error: {0}")]
|
||||
HardwareError(String),
|
||||
|
||||
/// Invalid state for requested operation
|
||||
#[error("Invalid state: {0}")]
|
||||
InvalidState(String),
|
||||
|
||||
/// Operation timed out
|
||||
#[error("Operation timed out")]
|
||||
Timeout,
|
||||
}
|
||||
|
||||
/// Errors that can occur during bill dispenser operations
|
||||
#[derive(Debug, Error)]
|
||||
pub enum DispenserError {
|
||||
/// Failed to connect to the dispenser
|
||||
#[error("Connection failed: {0}")]
|
||||
ConnectionFailed(String),
|
||||
|
||||
/// Communication error during operation
|
||||
#[error("Communication error: {0}")]
|
||||
CommunicationError(String),
|
||||
|
||||
/// Not enough bills to fulfill request
|
||||
#[error("Insufficient bills: need {0}, have {1}")]
|
||||
InsufficientBills(u32, u32),
|
||||
|
||||
/// Cassette is empty
|
||||
#[error("Cassette empty: denomination {0}")]
|
||||
CassetteEmpty(u32),
|
||||
|
||||
/// Bill jam detected
|
||||
#[error("Bill jam")]
|
||||
BillJam,
|
||||
|
||||
/// General hardware error
|
||||
#[error("Hardware error: {0}")]
|
||||
HardwareError(String),
|
||||
|
||||
/// Operation timed out
|
||||
#[error("Operation timed out")]
|
||||
Timeout,
|
||||
}
|
||||
|
||||
/// Errors that can occur during printer operations
|
||||
#[derive(Debug, Error)]
|
||||
pub enum PrinterError {
|
||||
/// Failed to connect to the printer
|
||||
#[error("Connection failed: {0}")]
|
||||
ConnectionFailed(String),
|
||||
|
||||
/// Communication error during operation
|
||||
#[error("Communication error: {0}")]
|
||||
CommunicationError(String),
|
||||
|
||||
/// Printer is out of paper
|
||||
#[error("Out of paper")]
|
||||
OutOfPaper,
|
||||
|
||||
/// Paper jam detected
|
||||
#[error("Paper jam")]
|
||||
PaperJam,
|
||||
|
||||
/// General hardware error
|
||||
#[error("Hardware error: {0}")]
|
||||
HardwareError(String),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue