@@ -405,7 +405,7 @@ pub fn do_test(data: &[u8]) {
405
405
406
406
loop {
407
407
macro_rules! send_payment {
408
- ( $source: expr, $dest: expr) => { {
408
+ ( $source: expr, $dest: expr, $amt : expr ) => { {
409
409
let payment_hash = Sha256 :: hash( & [ payment_id; 1 ] ) ;
410
410
payment_id = payment_id. wrapping_add( 1 ) ;
411
411
if let Err ( _) = $source. send_payment( & Route {
@@ -414,15 +414,15 @@ pub fn do_test(data: &[u8]) {
414
414
node_features: NodeFeatures :: empty( ) ,
415
415
short_channel_id: $dest. 1 ,
416
416
channel_features: ChannelFeatures :: empty( ) ,
417
- fee_msat: 5000000 ,
417
+ fee_msat: $amt ,
418
418
cltv_expiry_delta: 200 ,
419
419
} ] ] ,
420
420
} , PaymentHash ( payment_hash. into_inner( ) ) , & None ) {
421
421
// Probably ran out of funds
422
422
test_return!( ) ;
423
423
}
424
424
} } ;
425
- ( $source: expr, $middle: expr, $dest: expr) => { {
425
+ ( $source: expr, $middle: expr, $dest: expr, $amt : expr ) => { {
426
426
let payment_hash = Sha256 :: hash( & [ payment_id; 1 ] ) ;
427
427
payment_id = payment_id. wrapping_add( 1 ) ;
428
428
if let Err ( _) = $source. send_payment( & Route {
@@ -438,7 +438,7 @@ pub fn do_test(data: &[u8]) {
438
438
node_features: NodeFeatures :: empty( ) ,
439
439
short_channel_id: $dest. 1 ,
440
440
channel_features: ChannelFeatures :: empty( ) ,
441
- fee_msat: 5000000 ,
441
+ fee_msat: $amt ,
442
442
cltv_expiry_delta: 200 ,
443
443
} ] ] ,
444
444
} , PaymentHash ( payment_hash. into_inner( ) ) , & None ) {
@@ -688,12 +688,12 @@ pub fn do_test(data: &[u8]) {
688
688
nodes[ 2 ] . channel_monitor_updated ( & chan_2_funding, * id) ;
689
689
}
690
690
} ,
691
- 0x09 => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) ) ,
692
- 0x0a => send_payment ! ( nodes[ 1 ] , ( & nodes[ 0 ] , chan_a) ) ,
693
- 0x0b => send_payment ! ( nodes[ 1 ] , ( & nodes[ 2 ] , chan_b) ) ,
694
- 0x0c => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) ) ,
695
- 0x0d => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , ( & nodes[ 2 ] , chan_b) ) ,
696
- 0x0e => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , ( & nodes[ 0 ] , chan_a) ) ,
691
+ 0x09 => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , 5_000_000 ) ,
692
+ 0x0a => send_payment ! ( nodes[ 1 ] , ( & nodes[ 0 ] , chan_a) , 5_000_000 ) ,
693
+ 0x0b => send_payment ! ( nodes[ 1 ] , ( & nodes[ 2 ] , chan_b) , 5_000_000 ) ,
694
+ 0x0c => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , 5_000_000 ) ,
695
+ 0x0d => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , ( & nodes[ 2 ] , chan_b) , 5_000_000 ) ,
696
+ 0x0e => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , ( & nodes[ 0 ] , chan_a) , 5_000_000 ) ,
697
697
0x0f => {
698
698
if !chan_a_disconnected {
699
699
nodes[ 0 ] . peer_disconnected ( & nodes[ 1 ] . get_our_node_id ( ) , false ) ;
@@ -776,8 +776,26 @@ pub fn do_test(data: &[u8]) {
776
776
nodes[ 2 ] = node_c. clone ( ) ;
777
777
monitor_c = new_monitor_c;
778
778
} ,
779
- 0x22 => send_payment_with_secret ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , ( & nodes[ 2 ] , chan_b) ) ,
780
- 0x23 => send_payment_with_secret ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , ( & nodes[ 0 ] , chan_a) ) ,
779
+ 0x22 => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , 10 ) ,
780
+ 0x23 => send_payment ! ( nodes[ 1 ] , ( & nodes[ 0 ] , chan_a) , 10 ) ,
781
+ 0x25 => send_payment ! ( nodes[ 1 ] , ( & nodes[ 2 ] , chan_b) , 10 ) ,
782
+ 0x26 => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , 10 ) ,
783
+ 0x27 => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , ( & nodes[ 2 ] , chan_b) , 10 ) ,
784
+ 0x28 => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , ( & nodes[ 0 ] , chan_a) , 10 ) ,
785
+ 0x29 => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , 1_000 ) ,
786
+ 0x2a => send_payment ! ( nodes[ 1 ] , ( & nodes[ 0 ] , chan_a) , 1_000 ) ,
787
+ 0x2b => send_payment ! ( nodes[ 1 ] , ( & nodes[ 2 ] , chan_b) , 1_000 ) ,
788
+ 0x2c => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , 1_000 ) ,
789
+ 0x2d => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , ( & nodes[ 2 ] , chan_b) , 1_000 ) ,
790
+ 0x2e => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , ( & nodes[ 0 ] , chan_a) , 1_000 ) ,
791
+ 0x2f => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , 100_000 ) ,
792
+ 0x30 => send_payment ! ( nodes[ 1 ] , ( & nodes[ 0 ] , chan_a) , 100_000 ) ,
793
+ 0x31 => send_payment ! ( nodes[ 1 ] , ( & nodes[ 2 ] , chan_b) , 100_000 ) ,
794
+ 0x32 => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , 100_000 ) ,
795
+ 0x33 => send_payment ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , ( & nodes[ 2 ] , chan_b) , 100_000 ) ,
796
+ 0x34 => send_payment ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , ( & nodes[ 0 ] , chan_a) , 100_000 ) ,
797
+ 0x35 => send_payment_with_secret ! ( nodes[ 0 ] , ( & nodes[ 1 ] , chan_a) , ( & nodes[ 2 ] , chan_b) ) ,
798
+ 0x36 => send_payment_with_secret ! ( nodes[ 2 ] , ( & nodes[ 1 ] , chan_b) , ( & nodes[ 0 ] , chan_a) ) ,
781
799
// 0x24 defined above
782
800
_ => test_return ! ( ) ,
783
801
}
0 commit comments