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

Commit 34a33c8

Browse files
committed
f Fix tests
1 parent 0794837 commit 34a33c8

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

tests/common/mod.rs

+10-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use lightning::sign::EntropySource;
99

1010
use bitcoin::blockdata::constants::{genesis_block, ChainHash};
1111
use bitcoin::blockdata::transaction::Transaction;
12-
use bitcoin::network::constants::Network;
12+
use bitcoin::Network;
1313
use lightning::chain::channelmonitor::ANTI_REORG_DELAY;
1414
use lightning::chain::{chainmonitor, BestBlock, Confirm};
1515
use lightning::ln::channelmanager;
@@ -143,10 +143,10 @@ impl Drop for Node {
143143
}
144144

145145
struct Persister {
146-
graph_error: Option<(std::io::ErrorKind, &'static str)>,
146+
graph_error: Option<(lightning::io::ErrorKind, &'static str)>,
147147
graph_persistence_notifier: Option<SyncSender<()>>,
148-
manager_error: Option<(std::io::ErrorKind, &'static str)>,
149-
scorer_error: Option<(std::io::ErrorKind, &'static str)>,
148+
manager_error: Option<(lightning::io::ErrorKind, &'static str)>,
149+
scorer_error: Option<(lightning::io::ErrorKind, &'static str)>,
150150
kv_store: FilesystemStore,
151151
}
152152

@@ -162,19 +162,19 @@ impl Persister {
162162
}
163163
}
164164

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

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

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

177-
fn with_scorer_error(self, error: std::io::ErrorKind, message: &'static str) -> Self {
177+
fn with_scorer_error(self, error: lightning::io::ErrorKind, message: &'static str) -> Self {
178178
Self { scorer_error: Some((error, message)), ..self }
179179
}
180180
}
@@ -194,7 +194,7 @@ impl KVStore for Persister {
194194
&& key == CHANNEL_MANAGER_PERSISTENCE_KEY
195195
{
196196
if let Some((error, message)) = self.manager_error {
197-
return Err(std::io::Error::new(error, message));
197+
return Err(lightning::io::Error::new(error, message));
198198
}
199199
}
200200

@@ -212,7 +212,7 @@ impl KVStore for Persister {
212212
};
213213

214214
if let Some((error, message)) = self.graph_error {
215-
return Err(std::io::Error::new(error, message));
215+
return Err(lightning::io::Error::new(error, message));
216216
}
217217
}
218218

@@ -221,7 +221,7 @@ impl KVStore for Persister {
221221
&& key == SCORER_PERSISTENCE_KEY
222222
{
223223
if let Some((error, message)) = self.scorer_error {
224-
return Err(std::io::Error::new(error, message));
224+
return Err(lightning::io::Error::new(error, message));
225225
}
226226
}
227227

@@ -362,9 +362,6 @@ impl ScoreUpdate for TestScorer {
362362
fn time_passed(&mut self, _: Duration) {}
363363
}
364364

365-
#[cfg(c_bindings)]
366-
impl lightning::routing::scoring::Score for TestScorer {}
367-
368365
impl Drop for TestScorer {
369366
fn drop(&mut self) {
370367
if std::thread::panicking() {

0 commit comments

Comments
 (0)