mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-01-13 00:19:31 -05:00
05766d3146
Add a binary crate `swap` that implements two nodes (Alice and Bob). With this applied we can start up a node for each role and do: - Bob: Requests current amounts using BTC is input - Alice: Responds with amounts - Bob: (mock) get user input to Ok the amounts ... continue with swap (TODO)
19 lines
379 B
Rust
19 lines
379 B
Rust
use futures::prelude::*;
|
|
use libp2p::core::Executor;
|
|
use std::pin::Pin;
|
|
use tokio::runtime::Handle;
|
|
|
|
pub mod peer_tracker;
|
|
pub mod request_response;
|
|
pub mod transport;
|
|
|
|
pub struct TokioExecutor {
|
|
pub handle: Handle,
|
|
}
|
|
|
|
impl Executor for TokioExecutor {
|
|
fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) {
|
|
let _ = self.handle.spawn(future);
|
|
}
|
|
}
|