mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-30 04:26:33 -05:00
Do not introduced State6
This commit is contained in:
parent
8615aaed6e
commit
9a823dca4c
4 changed files with 30 additions and 41 deletions
|
|
@ -35,8 +35,12 @@ pub enum BobState {
|
|||
CancelTimelockExpired(State4),
|
||||
BtcCancelled(State4),
|
||||
BtcRefunded(State4),
|
||||
XmrRedeemed(State6),
|
||||
BtcPunished(State6),
|
||||
XmrRedeemed {
|
||||
tx_lock_id: bitcoin::Txid,
|
||||
},
|
||||
BtcPunished {
|
||||
tx_lock_id: bitcoin::Txid,
|
||||
},
|
||||
SafelyAborted,
|
||||
}
|
||||
|
||||
|
|
@ -52,8 +56,8 @@ impl fmt::Display for BobState {
|
|||
BobState::CancelTimelockExpired(..) => write!(f, "cancel timelock is expired"),
|
||||
BobState::BtcCancelled(..) => write!(f, "btc is cancelled"),
|
||||
BobState::BtcRefunded(..) => write!(f, "btc is refunded"),
|
||||
BobState::XmrRedeemed(..) => write!(f, "xmr is redeemed"),
|
||||
BobState::BtcPunished(..) => write!(f, "btc is punished"),
|
||||
BobState::XmrRedeemed { .. } => write!(f, "xmr is redeemed"),
|
||||
BobState::BtcPunished { .. } => write!(f, "btc is punished"),
|
||||
BobState::SafelyAborted => write!(f, "safely aborted"),
|
||||
}
|
||||
}
|
||||
|
|
@ -592,12 +596,6 @@ impl State4 {
|
|||
pub fn tx_lock_id(&self) -> bitcoin::Txid {
|
||||
self.tx_lock.txid()
|
||||
}
|
||||
|
||||
pub fn state6(&self) -> State6 {
|
||||
State6 {
|
||||
tx_lock_id: self.tx_lock.txid(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
||||
|
|
@ -650,21 +648,4 @@ impl State5 {
|
|||
pub fn tx_lock_id(&self) -> bitcoin::Txid {
|
||||
self.tx_lock.txid()
|
||||
}
|
||||
|
||||
pub fn state6(&self) -> State6 {
|
||||
State6 {
|
||||
tx_lock_id: self.tx_lock.txid(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
||||
pub struct State6 {
|
||||
pub tx_lock_id: Txid,
|
||||
}
|
||||
|
||||
impl State6 {
|
||||
pub fn tx_lock_id(&self) -> bitcoin::Txid {
|
||||
self.tx_lock_id
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue