@@ -1353,7 +1353,7 @@ mod tests {
1353
1353
. expect_send ( Amount :: ForInvoice ( final_value_msat) )
1354
1354
. expect_send ( Amount :: OnRetry ( final_value_msat / 2 ) ) ;
1355
1355
let router = TestRouter { } ;
1356
- let scorer = RefCell :: new ( TestScorer :: new ( ) . expect ( ExpectedPaymentResult :: PathFailure {
1356
+ let scorer = RefCell :: new ( TestScorer :: new ( ) . expect ( TestResult :: PaymentFailure {
1357
1357
path : path. clone ( ) , short_channel_id : path[ 0 ] . short_channel_id ,
1358
1358
} ) ) ;
1359
1359
let logger = TestLogger :: new ( ) ;
@@ -1389,8 +1389,8 @@ mod tests {
1389
1389
let payer = TestPayer :: new ( ) . expect_send ( Amount :: ForInvoice ( final_value_msat) ) ;
1390
1390
let router = TestRouter { } ;
1391
1391
let scorer = RefCell :: new ( TestScorer :: new ( )
1392
- . expect ( ExpectedPaymentResult :: PathSuccess { path : route. paths [ 0 ] . clone ( ) } )
1393
- . expect ( ExpectedPaymentResult :: PathSuccess { path : route. paths [ 1 ] . clone ( ) } )
1392
+ . expect ( TestResult :: PaymentSuccess { path : route. paths [ 0 ] . clone ( ) } )
1393
+ . expect ( TestResult :: PaymentSuccess { path : route. paths [ 1 ] . clone ( ) } )
1394
1394
) ;
1395
1395
let logger = TestLogger :: new ( ) ;
1396
1396
let invoice_payer =
@@ -1487,13 +1487,13 @@ mod tests {
1487
1487
}
1488
1488
1489
1489
struct TestScorer {
1490
- expectations : Option < VecDeque < ExpectedPaymentResult > > ,
1490
+ expectations : Option < VecDeque < TestResult > > ,
1491
1491
}
1492
1492
1493
1493
#[ derive( Debug ) ]
1494
- enum ExpectedPaymentResult {
1495
- PathFailure { path : Vec < RouteHop > , short_channel_id : u64 } ,
1496
- PathSuccess { path : Vec < RouteHop > } ,
1494
+ enum TestResult {
1495
+ PaymentFailure { path : Vec < RouteHop > , short_channel_id : u64 } ,
1496
+ PaymentSuccess { path : Vec < RouteHop > } ,
1497
1497
ProbeFailure { path : Vec < RouteHop > , short_channel_id : u64 } ,
1498
1498
ProbeSuccess { path : Vec < RouteHop > } ,
1499
1499
}
@@ -1505,7 +1505,7 @@ mod tests {
1505
1505
}
1506
1506
}
1507
1507
1508
- fn expect ( mut self , expectation : ExpectedPaymentResult ) -> Self {
1508
+ fn expect ( mut self , expectation : TestResult ) -> Self {
1509
1509
self . expectations . get_or_insert_with ( || VecDeque :: new ( ) ) . push_back ( expectation) ;
1510
1510
self
1511
1511
}
@@ -1524,17 +1524,17 @@ mod tests {
1524
1524
fn payment_path_failed ( & mut self , actual_path : & [ & RouteHop ] , actual_short_channel_id : u64 ) {
1525
1525
if let Some ( expectations) = & mut self . expectations {
1526
1526
match expectations. pop_front ( ) {
1527
- Some ( ExpectedPaymentResult :: PathFailure { path, short_channel_id } ) => {
1527
+ Some ( TestResult :: PaymentFailure { path, short_channel_id } ) => {
1528
1528
assert_eq ! ( actual_path, & path. iter( ) . collect:: <Vec <_>>( ) [ ..] ) ;
1529
1529
assert_eq ! ( actual_short_channel_id, short_channel_id) ;
1530
1530
} ,
1531
- Some ( ExpectedPaymentResult :: PathSuccess { path } ) => {
1531
+ Some ( TestResult :: PaymentSuccess { path } ) => {
1532
1532
panic ! ( "Unexpected successful payment path: {:?}" , path)
1533
1533
} ,
1534
- Some ( ExpectedPaymentResult :: ProbeFailure { path, .. } ) => {
1534
+ Some ( TestResult :: ProbeFailure { path, .. } ) => {
1535
1535
panic ! ( "Unexpected failed payment probe: {:?}" , path)
1536
1536
} ,
1537
- Some ( ExpectedPaymentResult :: ProbeSuccess { path } ) => {
1537
+ Some ( TestResult :: ProbeSuccess { path } ) => {
1538
1538
panic ! ( "Unexpected successful payment probe: {:?}" , path)
1539
1539
} ,
1540
1540
None => panic ! ( "Unexpected payment_path_failed call: {:?}" , actual_path) ,
@@ -1545,16 +1545,16 @@ mod tests {
1545
1545
fn payment_path_successful ( & mut self , actual_path : & [ & RouteHop ] ) {
1546
1546
if let Some ( expectations) = & mut self . expectations {
1547
1547
match expectations. pop_front ( ) {
1548
- Some ( ExpectedPaymentResult :: PathFailure { path, .. } ) => {
1548
+ Some ( TestResult :: PaymentFailure { path, .. } ) => {
1549
1549
panic ! ( "Unexpected payment path failure: {:?}" , path)
1550
1550
} ,
1551
- Some ( ExpectedPaymentResult :: PathSuccess { path } ) => {
1551
+ Some ( TestResult :: PaymentSuccess { path } ) => {
1552
1552
assert_eq ! ( actual_path, & path. iter( ) . collect:: <Vec <_>>( ) [ ..] ) ;
1553
1553
} ,
1554
- Some ( ExpectedPaymentResult :: ProbeFailure { path, .. } ) => {
1554
+ Some ( TestResult :: ProbeFailure { path, .. } ) => {
1555
1555
panic ! ( "Unexpected failed payment probe: {:?}" , path)
1556
1556
} ,
1557
- Some ( ExpectedPaymentResult :: ProbeSuccess { path } ) => {
1557
+ Some ( TestResult :: ProbeSuccess { path } ) => {
1558
1558
panic ! ( "Unexpected successful payment probe: {:?}" , path)
1559
1559
} ,
1560
1560
None => panic ! ( "Unexpected payment_path_successful call: {:?}" , actual_path) ,
@@ -1565,17 +1565,17 @@ mod tests {
1565
1565
fn probe_failed ( & mut self , actual_path : & [ & RouteHop ] , actual_short_channel_id : u64 ) {
1566
1566
if let Some ( expectations) = & mut self . expectations {
1567
1567
match expectations. pop_front ( ) {
1568
- Some ( ExpectedPaymentResult :: PathFailure { path, .. } ) => {
1568
+ Some ( TestResult :: PaymentFailure { path, .. } ) => {
1569
1569
panic ! ( "Unexpected failed payment path: {:?}" , path)
1570
1570
} ,
1571
- Some ( ExpectedPaymentResult :: PathSuccess { path } ) => {
1571
+ Some ( TestResult :: PaymentSuccess { path } ) => {
1572
1572
panic ! ( "Unexpected successful payment path: {:?}" , path)
1573
1573
} ,
1574
- Some ( ExpectedPaymentResult :: ProbeFailure { path, short_channel_id } ) => {
1574
+ Some ( TestResult :: ProbeFailure { path, short_channel_id } ) => {
1575
1575
assert_eq ! ( actual_path, & path. iter( ) . collect:: <Vec <_>>( ) [ ..] ) ;
1576
1576
assert_eq ! ( actual_short_channel_id, short_channel_id) ;
1577
1577
} ,
1578
- Some ( ExpectedPaymentResult :: ProbeSuccess { path } ) => {
1578
+ Some ( TestResult :: ProbeSuccess { path } ) => {
1579
1579
panic ! ( "Unexpected successful payment probe: {:?}" , path)
1580
1580
} ,
1581
1581
None => panic ! ( "Unexpected payment_path_failed call: {:?}" , actual_path) ,
@@ -1585,16 +1585,16 @@ mod tests {
1585
1585
fn probe_successful ( & mut self , actual_path : & [ & RouteHop ] ) {
1586
1586
if let Some ( expectations) = & mut self . expectations {
1587
1587
match expectations. pop_front ( ) {
1588
- Some ( ExpectedPaymentResult :: PathFailure { path, .. } ) => {
1588
+ Some ( TestResult :: PaymentFailure { path, .. } ) => {
1589
1589
panic ! ( "Unexpected payment path failure: {:?}" , path)
1590
1590
} ,
1591
- Some ( ExpectedPaymentResult :: PathSuccess { path } ) => {
1591
+ Some ( TestResult :: PaymentSuccess { path } ) => {
1592
1592
panic ! ( "Unexpected successful payment path: {:?}" , path)
1593
1593
} ,
1594
- Some ( ExpectedPaymentResult :: ProbeFailure { path, .. } ) => {
1594
+ Some ( TestResult :: ProbeFailure { path, .. } ) => {
1595
1595
panic ! ( "Unexpected failed payment probe: {:?}" , path)
1596
1596
} ,
1597
- Some ( ExpectedPaymentResult :: ProbeSuccess { path } ) => {
1597
+ Some ( TestResult :: ProbeSuccess { path } ) => {
1598
1598
assert_eq ! ( actual_path, & path. iter( ) . collect:: <Vec <_>>( ) [ ..] ) ;
1599
1599
} ,
1600
1600
None => panic ! ( "Unexpected payment_path_successful call: {:?}" , actual_path) ,
0 commit comments