use std::fmt;
use zenith_core::Diagnostic;
#[derive(Debug, Clone, PartialEq)]
pub enum TxStatus {
Accepted,
AcceptedWithWarnings,
Rejected,
}
#[derive(Debug, Clone, PartialEq)]
pub struct TxResult {
pub status: TxStatus,
pub diagnostics: Vec<Diagnostic>,
pub source_before: String,
pub source_after: String,
pub affected_node_ids: Vec<String>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct TxError {
pub message: String,
}
impl fmt::Display for TxError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "zenith-tx error: {}", self.message)
}
}
impl std::error::Error for TxError {}