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

Commit

Permalink
f Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Sep 2, 2024
1 parent 42b3a82 commit 84b221f
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use lightning::sign::EntropySource;

use bitcoin::blockdata::constants::{genesis_block, ChainHash};
use bitcoin::blockdata::transaction::Transaction;
use bitcoin::network::constants::Network;
use bitcoin::Network;
use lightning::chain::channelmonitor::ANTI_REORG_DELAY;
use lightning::chain::{chainmonitor, BestBlock, Confirm};
use lightning::ln::channelmanager;
Expand Down Expand Up @@ -143,10 +143,10 @@ impl Drop for Node {
}

struct Persister {
graph_error: Option<(std::io::ErrorKind, &'static str)>,
graph_error: Option<(lightning::io::ErrorKind, &'static str)>,
graph_persistence_notifier: Option<SyncSender<()>>,
manager_error: Option<(std::io::ErrorKind, &'static str)>,
scorer_error: Option<(std::io::ErrorKind, &'static str)>,
manager_error: Option<(lightning::io::ErrorKind, &'static str)>,
scorer_error: Option<(lightning::io::ErrorKind, &'static str)>,
kv_store: FilesystemStore,
}

Expand All @@ -162,19 +162,19 @@ impl Persister {
}
}

fn with_graph_error(self, error: std::io::ErrorKind, message: &'static str) -> Self {
fn with_graph_error(self, error: lightning::io::ErrorKind, message: &'static str) -> Self {
Self { graph_error: Some((error, message)), ..self }
}

fn with_graph_persistence_notifier(self, sender: SyncSender<()>) -> Self {
Self { graph_persistence_notifier: Some(sender), ..self }
}

fn with_manager_error(self, error: std::io::ErrorKind, message: &'static str) -> Self {
fn with_manager_error(self, error: lightning::io::ErrorKind, message: &'static str) -> Self {
Self { manager_error: Some((error, message)), ..self }
}

fn with_scorer_error(self, error: std::io::ErrorKind, message: &'static str) -> Self {
fn with_scorer_error(self, error: lightning::io::ErrorKind, message: &'static str) -> Self {
Self { scorer_error: Some((error, message)), ..self }
}
}
Expand All @@ -194,7 +194,7 @@ impl KVStore for Persister {
&& key == CHANNEL_MANAGER_PERSISTENCE_KEY
{
if let Some((error, message)) = self.manager_error {
return Err(std::io::Error::new(error, message));
return Err(lightning::io::Error::new(error, message));
}
}

Expand All @@ -212,7 +212,7 @@ impl KVStore for Persister {
};

if let Some((error, message)) = self.graph_error {
return Err(std::io::Error::new(error, message));
return Err(lightning::io::Error::new(error, message));
}
}

Expand All @@ -221,7 +221,7 @@ impl KVStore for Persister {
&& key == SCORER_PERSISTENCE_KEY
{
if let Some((error, message)) = self.scorer_error {
return Err(std::io::Error::new(error, message));
return Err(lightning::io::Error::new(error, message));
}
}

Expand Down Expand Up @@ -362,9 +362,6 @@ impl ScoreUpdate for TestScorer {
fn time_passed(&mut self, _: Duration) {}
}

#[cfg(c_bindings)]
impl lightning::routing::scoring::Score for TestScorer {}

impl Drop for TestScorer {
fn drop(&mut self) {
if std::thread::panicking() {
Expand Down

0 comments on commit 84b221f

Please sign in to comment.