@@ -462,7 +462,6 @@ mod tests {
462
462
use std:: cell:: RefCell ;
463
463
use std:: collections:: VecDeque ;
464
464
use std:: time:: { SystemTime , Duration } ;
465
- use std:: sync:: Mutex ;
466
465
467
466
fn invoice ( payment_preimage : PaymentPreimage ) -> Invoice {
468
467
let payment_hash = Sha256 :: hash ( & payment_preimage. 0 ) ;
@@ -1188,12 +1187,12 @@ mod tests {
1188
1187
}
1189
1188
1190
1189
// *** Full Featured Functional Tests with a Real ChannelManager ***
1191
- struct ManualRouter ( Mutex < VecDeque < Result < Route , LightningError > > > ) ;
1190
+ struct ManualRouter ( RefCell < VecDeque < Result < Route , LightningError > > > ) ;
1192
1191
1193
1192
impl < S : routing:: Score > Router < S > for ManualRouter {
1194
1193
fn find_route ( & self , _payer : & PublicKey , _params : & RouteParameters , _first_hops : Option < & [ & ChannelDetails ] > , _scorer : & S )
1195
1194
-> Result < Route , LightningError > {
1196
- self . 0 . lock ( ) . unwrap ( ) . pop_front ( ) . unwrap ( )
1195
+ self . 0 . borrow_mut ( ) . pop_front ( ) . unwrap ( )
1197
1196
}
1198
1197
}
1199
1198
@@ -1202,7 +1201,7 @@ mod tests {
1202
1201
if std:: thread:: panicking ( ) {
1203
1202
return ;
1204
1203
}
1205
- assert ! ( self . 0 . lock ( ) . unwrap ( ) . is_empty( ) ) ;
1204
+ assert ! ( self . 0 . borrow_mut ( ) . is_empty( ) ) ;
1206
1205
}
1207
1206
}
1208
1207
@@ -1244,7 +1243,7 @@ mod tests {
1244
1243
route. paths [ 0 ] [ 0 ] . fee_msat = 50_000_001 ;
1245
1244
route. paths [ 1 ] [ 0 ] . fee_msat = 50_000_000 ;
1246
1245
routes. push_back ( Ok ( route. clone ( ) ) ) ;
1247
- let route_res = ManualRouter ( Mutex :: new ( routes) ) ;
1246
+ let route_res = ManualRouter ( RefCell :: new ( routes) ) ;
1248
1247
1249
1248
let event_handled = core:: cell:: RefCell :: new ( false ) ;
1250
1249
let event_handler = |_: & _ | { * event_handled. borrow_mut ( ) = true ; } ;
0 commit comments