bark/exit/models/
package.rs

1use bitcoin::{Transaction, Txid};
2
3use crate::exit::models::states::ExitTxOrigin;
4
5#[derive(Clone, Debug, Eq, PartialEq)]
6pub struct ExitTransactionPackage {
7	/// The actual unilateral exit transaction containing an anchor output and a spendable amount
8	pub exit: TransactionInfo,
9	/// The child transaction used to spend, and thus confirm, the exit anchor output
10	pub child: Option<ChildTransactionInfo>,
11}
12
13/// An information struct used to pair the ID of a transaction with the full transaction for ease
14/// of use and readability for the user
15#[derive(Clone, Debug, Eq, PartialEq)]
16pub struct TransactionInfo {
17	pub txid: Txid,
18	pub tx: Transaction,
19}
20
21/// Represents a child transaction for an exit transaction package with information about the origin
22/// of the transaction
23#[derive(Clone, Debug, Eq, PartialEq)]
24pub struct ChildTransactionInfo {
25	pub info: TransactionInfo,
26	pub origin: ExitTxOrigin,
27}