mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-02-22 15:49:52 -05:00
Fix clippy warnings
This commit is contained in:
parent
697e1195cd
commit
6b7193b974
@ -69,13 +69,14 @@ pub async fn next_state<
|
||||
let state6 = state5.receive(message3);
|
||||
tracing::info!("alice has received bob message 3");
|
||||
tracing::info!("alice is redeeming btc");
|
||||
state6.redeem_btc(bitcoin_wallet).await.unwrap();
|
||||
state6.redeem_btc(bitcoin_wallet).await?;
|
||||
Ok(state6.into())
|
||||
}
|
||||
State::State6(state6) => Ok(state6.into()),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[derive(Debug)]
|
||||
pub enum State {
|
||||
State0(State0),
|
||||
@ -89,24 +90,15 @@ pub enum State {
|
||||
|
||||
// TODO: use macro or generics
|
||||
pub fn is_state4(state: &State) -> bool {
|
||||
match state {
|
||||
State::State4 { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(state, State::State4 { .. })
|
||||
}
|
||||
// TODO: use macro or generics
|
||||
pub fn is_state5(state: &State) -> bool {
|
||||
match state {
|
||||
State::State5 { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(state, State::State5 { .. })
|
||||
}
|
||||
// TODO: use macro or generics
|
||||
pub fn is_state6(state: &State) -> bool {
|
||||
match state {
|
||||
State::State6 { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(state, State::State6 { .. })
|
||||
}
|
||||
|
||||
macro_rules! impl_try_from_parent_state {
|
||||
|
@ -126,18 +126,12 @@ impl_from_child_state!(State5);
|
||||
|
||||
// TODO: use macro or generics
|
||||
pub fn is_state5(state: &State) -> bool {
|
||||
match state {
|
||||
State::State5 { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(state, State::State5 { .. })
|
||||
}
|
||||
|
||||
// TODO: use macro or generics
|
||||
pub fn is_state3(state: &State) -> bool {
|
||||
match state {
|
||||
State::State3 { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(state, State::State3 { .. })
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -124,7 +124,7 @@ pub async fn init_test<'a>(
|
||||
xmr_amount,
|
||||
RELATIVE_REFUND_TIMELOCK,
|
||||
RELATIVE_PUNISH_TIMELOCK,
|
||||
refund_address.clone(),
|
||||
refund_address,
|
||||
);
|
||||
let initial_balances = InitialBalances {
|
||||
alice_xmr: alice_initial_xmr_balance,
|
||||
|
Loading…
x
Reference in New Issue
Block a user