Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 4493ef3

Browse files
authored
Merge pull request #48 from tnull/2023-11-crate-restructuring
Restructure crate
2 parents fb65ead + ad3cc2f commit 4493ef3

18 files changed

+191
-447
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ jobs:
4747
run: rustup component add rustfmt && cargo fmt --all -- --check
4848
- name: Test on Rust ${{ matrix.toolchain }}
4949
run: cargo test
50+
- name: Test on Rust ${{ matrix.toolchain }} with LSPS1 support
51+
run: RUSTFLAGS="--cfg lsps1" cargo test

src/events.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
//! [`LiquidityManager::get_and_clear_pending_events`] to receive events.
1515
//!
1616
//! [`LiquidityManager::get_and_clear_pending_events`]: crate::LiquidityManager::get_and_clear_pending_events
17-
/// [`crate::LiquidityManager::get_and_clear_pending_events()`] to receive events.
18-
use crate::channel_request;
19-
use crate::jit_channel;
17+
18+
#[cfg(lsps1)]
19+
use crate::lsps1;
20+
use crate::lsps2;
2021
use std::collections::VecDeque;
2122
use std::sync::{Condvar, Mutex};
2223

@@ -61,7 +62,8 @@ impl EventQueue {
6162
#[derive(Debug, Clone, PartialEq, Eq)]
6263
pub enum Event {
6364
/// An LSPS2 (JIT Channel) protocol event.
64-
LSPS2(jit_channel::LSPS2Event),
65+
LSPS2(lsps2::LSPS2Event),
6566
/// An LSPS1 protocol event.
66-
LSPS1(channel_request::event::Event),
67+
#[cfg(lsps1)]
68+
LSPS1(lsps1::event::Event),
6769
}

src/lib.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@
1818
#![allow(clippy::drop_non_drop)]
1919
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2020

21-
mod channel_request;
2221
pub mod events;
23-
pub mod jit_channel;
24-
mod transport;
22+
mod lsps0;
23+
#[cfg(lsps1)]
24+
mod lsps1;
25+
pub mod lsps2;
2526
mod utils;
2627

27-
pub use channel_request::event::Event as LSPS1Event;
28-
pub use transport::message_handler::{
29-
JITChannelsConfig, LiquidityManager, LiquidityProviderConfig,
30-
};
31-
pub use transport::msgs::{RawLSPSMessage, LSPS_MESSAGE_TYPE_ID};
28+
pub use lsps0::message_handler::{JITChannelsConfig, LiquidityManager, LiquidityProviderConfig};

0 commit comments

Comments
 (0)