Skip to content

Commit 6ea47bb

Browse files
committed
sim-lib: add graph implementation of SimNetwork trait
Add an implementation of our SimNetwork trait that will do the heavy lifting of propagating htlcs through a simulated network.
1 parent b4c906a commit 6ea47bb

File tree

2 files changed

+348
-5
lines changed

2 files changed

+348
-5
lines changed

sim-lib/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl std::fmt::Display for NodeId {
8686
}
8787

8888
/// Represents a short channel ID, expressed as a struct so that we can implement display for the trait.
89-
#[derive(Debug, Clone)]
89+
#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)]
9090
pub struct ShortChannelID(u64);
9191

9292
/// Utility function to easily convert from u64 to `ShortChannelID`
@@ -165,6 +165,8 @@ pub enum SimulationError {
165165
FileError,
166166
#[error("{0}")]
167167
RandomActivityError(RandomActivityError),
168+
#[error("Simulated Network Error: {0}")]
169+
SimulatedNetworkError(String),
168170
}
169171

170172
#[derive(Debug, Error)]

0 commit comments

Comments
 (0)