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

Restructure crate #48

Merged
merged 6 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ jobs:
run: rustup component add rustfmt && cargo fmt --all -- --check
- name: Test on Rust ${{ matrix.toolchain }}
run: cargo test
- name: Test on Rust ${{ matrix.toolchain }} with LSPS1 support
run: RUSTFLAGS="--cfg lsps1" cargo test
12 changes: 7 additions & 5 deletions src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
//! [`LiquidityManager::get_and_clear_pending_events`] to receive events.
//!
//! [`LiquidityManager::get_and_clear_pending_events`]: crate::LiquidityManager::get_and_clear_pending_events
/// [`crate::LiquidityManager::get_and_clear_pending_events()`] to receive events.
use crate::channel_request;
use crate::jit_channel;

#[cfg(lsps1)]
use crate::lsps1;
use crate::lsps2;
use std::collections::VecDeque;
use std::sync::{Condvar, Mutex};

Expand Down Expand Up @@ -61,7 +62,8 @@ impl EventQueue {
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Event {
/// An LSPS2 (JIT Channel) protocol event.
LSPS2(jit_channel::LSPS2Event),
LSPS2(lsps2::LSPS2Event),
/// An LSPS1 protocol event.
LSPS1(channel_request::event::Event),
#[cfg(lsps1)]
LSPS1(lsps1::event::Event),
}
13 changes: 5 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@
#![allow(clippy::drop_non_drop)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod channel_request;
pub mod events;
pub mod jit_channel;
mod transport;
mod lsps0;
#[cfg(lsps1)]
mod lsps1;
pub mod lsps2;
mod utils;

pub use channel_request::event::Event as LSPS1Event;
pub use transport::message_handler::{
JITChannelsConfig, LiquidityManager, LiquidityProviderConfig,
};
pub use transport::msgs::{RawLSPSMessage, LSPS_MESSAGE_TYPE_ID};
pub use lsps0::message_handler::{JITChannelsConfig, LiquidityManager, LiquidityProviderConfig};
Loading