Skip to content

Commit 4f60b71

Browse files
committed
[fuzz] Reduce overuse of macros/Arcs in chanmon_consistency
In some upcoming changes the macros in chanmon_consistency ended up blowing up rustc a bit resulting in 20+GB memory usage and long compile times. Shorter function bodies fix this.
1 parent 6ccaf33 commit 4f60b71

File tree

1 file changed

+155
-152
lines changed

1 file changed

+155
-152
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 155 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,93 @@ impl KeysInterface for KeyProvider {
186186
}
187187
}
188188

189+
#[inline]
190+
fn check_api_err(api_err: APIError) {
191+
match api_err {
192+
APIError::APIMisuseError { .. } => panic!("We can't misuse the API"),
193+
APIError::FeeRateTooHigh { .. } => panic!("We can't send too much fee?"),
194+
APIError::RouteError { .. } => panic!("Our routes should work"),
195+
APIError::ChannelUnavailable { err } => {
196+
// Test the error against a list of errors we can hit, and reject
197+
// all others. If you hit this panic, the list of acceptable errors
198+
// is probably just stale and you should add new messages here.
199+
match err.as_str() {
200+
"Peer for first hop currently disconnected/pending monitor update!" => {},
201+
_ if err.starts_with("Cannot push more than their max accepted HTLCs ") => {},
202+
_ if err.starts_with("Cannot send value that would put us over the max HTLC value in flight our peer will accept ") => {},
203+
_ if err.starts_with("Cannot send value that would put our balance under counterparty-announced channel reserve value") => {},
204+
_ if err.starts_with("Cannot send value that would overdraw remaining funds.") => {},
205+
_ if err.starts_with("Cannot send value that would not leave enough to pay for fees.") => {},
206+
_ => panic!(err),
207+
}
208+
},
209+
APIError::MonitorUpdateFailed => {
210+
// We can (obviously) temp-fail a monitor update
211+
},
212+
}
213+
}
214+
#[inline]
215+
fn check_payment_err(send_err: PaymentSendFailure) {
216+
match send_err {
217+
PaymentSendFailure::ParameterError(api_err) => check_api_err(api_err),
218+
PaymentSendFailure::PathParameterError(per_path_results) => {
219+
for res in per_path_results { if let Err(api_err) = res { check_api_err(api_err); } }
220+
},
221+
PaymentSendFailure::AllFailedRetrySafe(per_path_results) => {
222+
for api_err in per_path_results { check_api_err(api_err); }
223+
},
224+
PaymentSendFailure::PartialFailure(per_path_results) => {
225+
for res in per_path_results { if let Err(api_err) = res { check_api_err(api_err); } }
226+
},
227+
}
228+
}
229+
230+
type ChanMan = ChannelManager<EnforcingChannelKeys, Arc<TestChainMonitor>, Arc<TestBroadcaster>, Arc<KeyProvider>, Arc<FuzzEstimator>, Arc<dyn Logger>>;
231+
232+
#[inline]
233+
fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, payment_id: &mut u8) -> bool {
234+
let payment_hash = Sha256::hash(&[*payment_id; 1]);
235+
*payment_id = payment_id.wrapping_add(1);
236+
if let Err(err) = source.send_payment(&Route {
237+
paths: vec![vec![RouteHop {
238+
pubkey: dest.get_our_node_id(),
239+
node_features: NodeFeatures::empty(),
240+
short_channel_id: dest_chan_id,
241+
channel_features: ChannelFeatures::empty(),
242+
fee_msat: amt,
243+
cltv_expiry_delta: 200,
244+
}]],
245+
}, PaymentHash(payment_hash.into_inner()), &None) {
246+
check_payment_err(err);
247+
false
248+
} else { true }
249+
}
250+
#[inline]
251+
fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, dest: &ChanMan, dest_chan_id: u64, amt: u64, payment_id: &mut u8) -> bool {
252+
let payment_hash = Sha256::hash(&[*payment_id; 1]);
253+
*payment_id = payment_id.wrapping_add(1);
254+
if let Err(err) = source.send_payment(&Route {
255+
paths: vec![vec![RouteHop {
256+
pubkey: middle.get_our_node_id(),
257+
node_features: NodeFeatures::empty(),
258+
short_channel_id: middle_chan_id,
259+
channel_features: ChannelFeatures::empty(),
260+
fee_msat: 50000,
261+
cltv_expiry_delta: 100,
262+
},RouteHop {
263+
pubkey: dest.get_our_node_id(),
264+
node_features: NodeFeatures::empty(),
265+
short_channel_id: dest_chan_id,
266+
channel_features: ChannelFeatures::empty(),
267+
fee_msat: amt,
268+
cltv_expiry_delta: 200,
269+
}]],
270+
}, PaymentHash(payment_hash.into_inner()), &None) {
271+
check_payment_err(err);
272+
false
273+
} else { true }
274+
}
275+
189276
#[inline]
190277
pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
191278
let fee_est = Arc::new(FuzzEstimator{});
@@ -201,7 +288,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
201288
config.channel_options.fee_proportional_millionths = 0;
202289
config.channel_options.announced_channel = true;
203290
config.peer_channel_config_limits.min_dust_limit_satoshis = 0;
204-
(Arc::new(ChannelManager::new(Network::Bitcoin, fee_est.clone(), monitor.clone(), broadcast.clone(), Arc::clone(&logger), keys_manager.clone(), config, 0)),
291+
(ChannelManager::new(Network::Bitcoin, fee_est.clone(), monitor.clone(), broadcast.clone(), Arc::clone(&logger), keys_manager.clone(), config, 0),
205292
monitor)
206293
} }
207294
}
@@ -238,7 +325,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
238325
channel_monitors: monitor_refs,
239326
};
240327

241-
(<(BlockHash, ChannelManager<EnforcingChannelKeys, Arc<TestChainMonitor>, Arc<TestBroadcaster>, Arc<KeyProvider>, Arc<FuzzEstimator>, Arc<dyn Logger>>)>::read(&mut Cursor::new(&$ser.0), read_args).expect("Failed to read manager").1, chain_monitor)
328+
(<(BlockHash, ChanMan)>::read(&mut Cursor::new(&$ser.0), read_args).expect("Failed to read manager").1, chain_monitor)
242329
} }
243330
}
244331

@@ -348,9 +435,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
348435

349436
// 3 nodes is enough to hit all the possible cases, notably unknown-source-unknown-dest
350437
// forwarding.
351-
let (mut node_a, mut monitor_a) = make_node!(0);
352-
let (mut node_b, mut monitor_b) = make_node!(1);
353-
let (mut node_c, mut monitor_c) = make_node!(2);
438+
let (node_a, mut monitor_a) = make_node!(0);
439+
let (node_b, mut monitor_b) = make_node!(1);
440+
let (node_c, mut monitor_c) = make_node!(2);
354441

355442
let mut nodes = [node_a, node_b, node_c];
356443

@@ -366,7 +453,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
366453
let chan_a = nodes[0].list_usable_channels()[0].short_channel_id.unwrap();
367454
let chan_b = nodes[2].list_usable_channels()[0].short_channel_id.unwrap();
368455

369-
let mut payment_id = 0;
456+
let mut payment_id: u8 = 0;
370457

371458
let mut chan_a_disconnected = false;
372459
let mut chan_b_disconnected = false;
@@ -404,87 +491,6 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
404491
}
405492

406493
loop {
407-
macro_rules! check_send_res { ($send_err: expr) => { {
408-
macro_rules! check_res { ($api_err: expr) => { {
409-
match $api_err {
410-
APIError::APIMisuseError { .. } => panic!("We can't misuse the API"),
411-
APIError::FeeRateTooHigh { .. } => panic!("We can't send too much fee?"),
412-
APIError::RouteError { .. } => panic!("Our routes should work"),
413-
APIError::ChannelUnavailable { err } => {
414-
// Test the error against a list of errors we can hit, and reject
415-
// all others. If you hit this panic, the list of acceptable errors
416-
// is probably just stale and you should add new messages here.
417-
match err.as_str() {
418-
"Peer for first hop currently disconnected/pending monitor update!" => test_return!(),
419-
_ if err.starts_with("Cannot push more than their max accepted HTLCs ") => test_return!(),
420-
_ if err.starts_with("Cannot send value that would put us over the max HTLC value in flight our peer will accept ") => test_return!(),
421-
_ if err.starts_with("Cannot send value that would put our balance under counterparty-announced channel reserve value") => test_return!(),
422-
_ if err.starts_with("Cannot send value that would overdraw remaining funds.") => test_return!(),
423-
_ if err.starts_with("Cannot send value that would not leave enough to pay for fees.") => test_return!(),
424-
_ => panic!(err),
425-
}
426-
},
427-
APIError::MonitorUpdateFailed => {
428-
// We can (obviously) temp-fail a monitor update
429-
test_return!()
430-
},
431-
}
432-
} } }
433-
match $send_err {
434-
PaymentSendFailure::ParameterError(api_err) => check_res!(api_err),
435-
PaymentSendFailure::PathParameterError(per_path_results) => {
436-
for res in per_path_results { if let Err(api_err) = res { check_res!(api_err); } }
437-
},
438-
PaymentSendFailure::AllFailedRetrySafe(per_path_results) => {
439-
for api_err in per_path_results { check_res!(api_err); }
440-
},
441-
PaymentSendFailure::PartialFailure(per_path_results) => {
442-
for res in per_path_results { if let Err(api_err) = res { check_res!(api_err); } }
443-
},
444-
}
445-
} } }
446-
447-
macro_rules! send_payment {
448-
($source: expr, $dest: expr, $amt: expr) => { {
449-
let payment_hash = Sha256::hash(&[payment_id; 1]);
450-
payment_id = payment_id.wrapping_add(1);
451-
if let Err(err) = $source.send_payment(&Route {
452-
paths: vec![vec![RouteHop {
453-
pubkey: $dest.0.get_our_node_id(),
454-
node_features: NodeFeatures::empty(),
455-
short_channel_id: $dest.1,
456-
channel_features: ChannelFeatures::empty(),
457-
fee_msat: $amt,
458-
cltv_expiry_delta: 200,
459-
}]],
460-
}, PaymentHash(payment_hash.into_inner()), &None) {
461-
check_send_res!(err);
462-
}
463-
} };
464-
($source: expr, $middle: expr, $dest: expr, $amt: expr) => { {
465-
let payment_hash = Sha256::hash(&[payment_id; 1]);
466-
payment_id = payment_id.wrapping_add(1);
467-
if let Err(err) = $source.send_payment(&Route {
468-
paths: vec![vec![RouteHop {
469-
pubkey: $middle.0.get_our_node_id(),
470-
node_features: NodeFeatures::empty(),
471-
short_channel_id: $middle.1,
472-
channel_features: ChannelFeatures::empty(),
473-
fee_msat: 50000,
474-
cltv_expiry_delta: 100,
475-
},RouteHop {
476-
pubkey: $dest.0.get_our_node_id(),
477-
node_features: NodeFeatures::empty(),
478-
short_channel_id: $dest.1,
479-
channel_features: ChannelFeatures::empty(),
480-
fee_msat: $amt,
481-
cltv_expiry_delta: 200,
482-
}]],
483-
}, PaymentHash(payment_hash.into_inner()), &None) {
484-
check_send_res!(err);
485-
}
486-
} }
487-
}
488494
macro_rules! send_payment_with_secret {
489495
($source: expr, $middle: expr, $dest: expr) => { {
490496
let payment_hash = Sha256::hash(&[payment_id; 1]);
@@ -522,7 +528,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
522528
cltv_expiry_delta: 200,
523529
}]],
524530
}, PaymentHash(payment_hash.into_inner()), &Some(PaymentSecret(payment_secret.into_inner()))) {
525-
check_send_res!(err);
531+
check_payment_err(err);
526532
}
527533
} }
528534
}
@@ -774,8 +780,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
774780
drain_msg_events_on_disconnect!(0);
775781
}
776782
let (new_node_a, new_monitor_a) = reload_node!(node_a_ser, 0, monitor_a);
777-
node_a = Arc::new(new_node_a);
778-
nodes[0] = node_a.clone();
783+
nodes[0] = new_node_a;
779784
monitor_a = new_monitor_a;
780785
},
781786
0x1d => {
@@ -792,8 +797,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
792797
bc_events.clear();
793798
}
794799
let (new_node_b, new_monitor_b) = reload_node!(node_b_ser, 1, monitor_b);
795-
node_b = Arc::new(new_node_b);
796-
nodes[1] = node_b.clone();
800+
nodes[1] = new_node_b;
797801
monitor_b = new_monitor_b;
798802
},
799803
0x1e => {
@@ -803,70 +807,69 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
803807
drain_msg_events_on_disconnect!(2);
804808
}
805809
let (new_node_c, new_monitor_c) = reload_node!(node_c_ser, 2, monitor_c);
806-
node_c = Arc::new(new_node_c);
807-
nodes[2] = node_c.clone();
810+
nodes[2] = new_node_c;
808811
monitor_c = new_monitor_c;
809812
},
810813

811814
// 1/10th the channel size:
812-
0x20 => send_payment!(nodes[0], (&nodes[1], chan_a), 10_000_000),
813-
0x21 => send_payment!(nodes[1], (&nodes[0], chan_a), 10_000_000),
814-
0x22 => send_payment!(nodes[1], (&nodes[2], chan_b), 10_000_000),
815-
0x23 => send_payment!(nodes[2], (&nodes[1], chan_b), 10_000_000),
816-
0x24 => send_payment!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b), 10_000_000),
817-
0x25 => send_payment!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a), 10_000_000),
818-
819-
0x26 => send_payment_with_secret!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b)),
820-
0x27 => send_payment_with_secret!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a)),
821-
822-
0x28 => send_payment!(nodes[0], (&nodes[1], chan_a), 1_000_000),
823-
0x29 => send_payment!(nodes[1], (&nodes[0], chan_a), 1_000_000),
824-
0x2a => send_payment!(nodes[1], (&nodes[2], chan_b), 1_000_000),
825-
0x2b => send_payment!(nodes[2], (&nodes[1], chan_b), 1_000_000),
826-
0x2c => send_payment!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b), 1_000_000),
827-
0x2d => send_payment!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a), 1_000_000),
828-
829-
0x30 => send_payment!(nodes[0], (&nodes[1], chan_a), 100_000),
830-
0x31 => send_payment!(nodes[1], (&nodes[0], chan_a), 100_000),
831-
0x32 => send_payment!(nodes[1], (&nodes[2], chan_b), 100_000),
832-
0x33 => send_payment!(nodes[2], (&nodes[1], chan_b), 100_000),
833-
0x34 => send_payment!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b), 100_000),
834-
0x35 => send_payment!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a), 100_000),
835-
836-
0x38 => send_payment!(nodes[0], (&nodes[1], chan_a), 10_000),
837-
0x39 => send_payment!(nodes[1], (&nodes[0], chan_a), 10_000),
838-
0x3a => send_payment!(nodes[1], (&nodes[2], chan_b), 10_000),
839-
0x3b => send_payment!(nodes[2], (&nodes[1], chan_b), 10_000),
840-
0x3c => send_payment!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b), 10_000),
841-
0x3d => send_payment!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a), 10_000),
842-
843-
0x40 => send_payment!(nodes[0], (&nodes[1], chan_a), 1_000),
844-
0x41 => send_payment!(nodes[1], (&nodes[0], chan_a), 1_000),
845-
0x42 => send_payment!(nodes[1], (&nodes[2], chan_b), 1_000),
846-
0x43 => send_payment!(nodes[2], (&nodes[1], chan_b), 1_000),
847-
0x44 => send_payment!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b), 1_000),
848-
0x45 => send_payment!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a), 1_000),
849-
850-
0x48 => send_payment!(nodes[0], (&nodes[1], chan_a), 100),
851-
0x49 => send_payment!(nodes[1], (&nodes[0], chan_a), 100),
852-
0x4a => send_payment!(nodes[1], (&nodes[2], chan_b), 100),
853-
0x4b => send_payment!(nodes[2], (&nodes[1], chan_b), 100),
854-
0x4c => send_payment!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b), 100),
855-
0x4d => send_payment!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a), 100),
856-
857-
0x50 => send_payment!(nodes[0], (&nodes[1], chan_a), 10),
858-
0x51 => send_payment!(nodes[1], (&nodes[0], chan_a), 10),
859-
0x52 => send_payment!(nodes[1], (&nodes[2], chan_b), 10),
860-
0x53 => send_payment!(nodes[2], (&nodes[1], chan_b), 10),
861-
0x54 => send_payment!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b), 10),
862-
0x55 => send_payment!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a), 10),
863-
864-
0x58 => send_payment!(nodes[0], (&nodes[1], chan_a), 1),
865-
0x59 => send_payment!(nodes[1], (&nodes[0], chan_a), 1),
866-
0x5a => send_payment!(nodes[1], (&nodes[2], chan_b), 1),
867-
0x5b => send_payment!(nodes[2], (&nodes[1], chan_b), 1),
868-
0x5c => send_payment!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b), 1),
869-
0x5d => send_payment!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a), 1),
815+
0x20 => { send_payment(&nodes[0], &nodes[1], chan_a, 10_000_000, &mut payment_id); },
816+
0x21 => { send_payment(&nodes[1], &nodes[0], chan_a, 10_000_000, &mut payment_id); },
817+
0x22 => { send_payment(&nodes[1], &nodes[2], chan_b, 10_000_000, &mut payment_id); },
818+
0x23 => { send_payment(&nodes[2], &nodes[1], chan_b, 10_000_000, &mut payment_id); },
819+
0x24 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10_000_000, &mut payment_id); },
820+
0x25 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10_000_000, &mut payment_id); },
821+
822+
0x26 => { send_payment_with_secret!(nodes[0], (&nodes[1], chan_a), (&nodes[2], chan_b)); },
823+
0x27 => { send_payment_with_secret!(nodes[2], (&nodes[1], chan_b), (&nodes[0], chan_a)); },
824+
825+
0x28 => { send_payment(&nodes[0], &nodes[1], chan_a, 1_000_000, &mut payment_id); },
826+
0x29 => { send_payment(&nodes[1], &nodes[0], chan_a, 1_000_000, &mut payment_id); },
827+
0x2a => { send_payment(&nodes[1], &nodes[2], chan_b, 1_000_000, &mut payment_id); },
828+
0x2b => { send_payment(&nodes[2], &nodes[1], chan_b, 1_000_000, &mut payment_id); },
829+
0x2c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1_000_000, &mut payment_id); },
830+
0x2d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1_000_000, &mut payment_id); },
831+
832+
0x30 => { send_payment(&nodes[0], &nodes[1], chan_a, 100_000, &mut payment_id); },
833+
0x31 => { send_payment(&nodes[1], &nodes[0], chan_a, 100_000, &mut payment_id); },
834+
0x32 => { send_payment(&nodes[1], &nodes[2], chan_b, 100_000, &mut payment_id); },
835+
0x33 => { send_payment(&nodes[2], &nodes[1], chan_b, 100_000, &mut payment_id); },
836+
0x34 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 100_000, &mut payment_id); },
837+
0x35 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 100_000, &mut payment_id); },
838+
839+
0x38 => { send_payment(&nodes[0], &nodes[1], chan_a, 10_000, &mut payment_id); },
840+
0x39 => { send_payment(&nodes[1], &nodes[0], chan_a, 10_000, &mut payment_id); },
841+
0x3a => { send_payment(&nodes[1], &nodes[2], chan_b, 10_000, &mut payment_id); },
842+
0x3b => { send_payment(&nodes[2], &nodes[1], chan_b, 10_000, &mut payment_id); },
843+
0x3c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10_000, &mut payment_id); },
844+
0x3d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10_000, &mut payment_id); },
845+
846+
0x40 => { send_payment(&nodes[0], &nodes[1], chan_a, 1_000, &mut payment_id); },
847+
0x41 => { send_payment(&nodes[1], &nodes[0], chan_a, 1_000, &mut payment_id); },
848+
0x42 => { send_payment(&nodes[1], &nodes[2], chan_b, 1_000, &mut payment_id); },
849+
0x43 => { send_payment(&nodes[2], &nodes[1], chan_b, 1_000, &mut payment_id); },
850+
0x44 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1_000, &mut payment_id); },
851+
0x45 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1_000, &mut payment_id); },
852+
853+
0x48 => { send_payment(&nodes[0], &nodes[1], chan_a, 100, &mut payment_id); },
854+
0x49 => { send_payment(&nodes[1], &nodes[0], chan_a, 100, &mut payment_id); },
855+
0x4a => { send_payment(&nodes[1], &nodes[2], chan_b, 100, &mut payment_id); },
856+
0x4b => { send_payment(&nodes[2], &nodes[1], chan_b, 100, &mut payment_id); },
857+
0x4c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 100, &mut payment_id); },
858+
0x4d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 100, &mut payment_id); },
859+
860+
0x50 => { send_payment(&nodes[0], &nodes[1], chan_a, 10, &mut payment_id); },
861+
0x51 => { send_payment(&nodes[1], &nodes[0], chan_a, 10, &mut payment_id); },
862+
0x52 => { send_payment(&nodes[1], &nodes[2], chan_b, 10, &mut payment_id); },
863+
0x53 => { send_payment(&nodes[2], &nodes[1], chan_b, 10, &mut payment_id); },
864+
0x54 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10, &mut payment_id); },
865+
0x55 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10, &mut payment_id); },
866+
867+
0x58 => { send_payment(&nodes[0], &nodes[1], chan_a, 1, &mut payment_id); },
868+
0x59 => { send_payment(&nodes[1], &nodes[0], chan_a, 1, &mut payment_id); },
869+
0x5a => { send_payment(&nodes[1], &nodes[2], chan_b, 1, &mut payment_id); },
870+
0x5b => { send_payment(&nodes[2], &nodes[1], chan_b, 1, &mut payment_id); },
871+
0x5c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1, &mut payment_id); },
872+
0x5d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1, &mut payment_id); },
870873

871874
_ => test_return!(),
872875
}

0 commit comments

Comments
 (0)