mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-01-26 15:27:19 -05:00
Derive Default
This commit is contained in:
parent
acfd43ee79
commit
2dceab28a4
@ -280,7 +280,7 @@ impl From<message3::OutEvent> for OutEvent {
|
||||
}
|
||||
|
||||
/// A `NetworkBehaviour` that represents an XMR/BTC swap node as Alice.
|
||||
#[derive(NetworkBehaviour)]
|
||||
#[derive(NetworkBehaviour, Default)]
|
||||
#[behaviour(out_event = "OutEvent", event_process = false)]
|
||||
#[allow(missing_debug_implementations)]
|
||||
pub struct Behaviour {
|
||||
@ -318,16 +318,3 @@ impl Behaviour {
|
||||
debug!("Sent Message2");
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Behaviour {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
pt: PeerTracker::default(),
|
||||
amounts: Amounts::default(),
|
||||
message0: message0::Behaviour::default(),
|
||||
message1: message1::Behaviour::default(),
|
||||
message2: message2::Behaviour::default(),
|
||||
message3: message3::Behaviour::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ impl From<message3::OutEvent> for OutEvent {
|
||||
}
|
||||
|
||||
/// A `NetworkBehaviour` that represents an XMR/BTC swap node as Bob.
|
||||
#[derive(NetworkBehaviour)]
|
||||
#[derive(NetworkBehaviour, Default)]
|
||||
#[behaviour(out_event = "OutEvent", event_process = false)]
|
||||
#[allow(missing_debug_implementations)]
|
||||
pub struct Behaviour {
|
||||
@ -311,16 +311,3 @@ impl Behaviour {
|
||||
self.pt.add_address(peer_id, address)
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Behaviour {
|
||||
fn default() -> Behaviour {
|
||||
Self {
|
||||
pt: PeerTracker::default(),
|
||||
amounts: Amounts::default(),
|
||||
message0: message0::Behaviour::default(),
|
||||
message1: message1::Behaviour::default(),
|
||||
message2: message2::Behaviour::default(),
|
||||
message3: message3::Behaviour::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user