From: Matt Corallo Date: Thu, 7 Mar 2019 16:33:19 +0000 (-0500) Subject: TESTING X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=a6465d843bb2f51bc432b04d5da259dbf062ee5a;p=rust-lightning TESTING --- diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs index e9f56a3e4..5edc680c2 100644 --- a/fuzz/src/chanmon_consistency.rs +++ b/fuzz/src/chanmon_consistency.rs @@ -499,7 +499,28 @@ pub fn do_test(data: &[u8], out: Out) { bc_events.clear(); new_events } else { Vec::new() }; - for event in events.iter().chain(nodes[$node].get_and_clear_pending_msg_events().iter()) { + let ev = nodes[$node].get_and_clear_pending_msg_events(); + for event in events.iter().chain(ev.iter()) { + match event { + events::MessageSendEvent::UpdateHTLCs { updates: CommitmentUpdate { ref update_add_htlcs, ref update_fail_htlcs, ref update_fulfill_htlcs, ref update_fail_malformed_htlcs, .. }, .. } => { + println!("UPDATEHTLCs {} {} {} {}", update_add_htlcs.len(), update_fail_htlcs.len(), update_fulfill_htlcs.len(), update_fail_malformed_htlcs.len()); + }, + events::MessageSendEvent::SendRevokeAndACK { .. } => { + println!("RAA"); + }, + events::MessageSendEvent::SendChannelReestablish { .. } => { + println!("Chan REE"); + }, + events::MessageSendEvent::SendFundingLocked { .. } => { + println!("FL"); + }, + events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => { + println!("Fail net update"); + }, + _ => panic!("Unhandled message event"), + } + } + for event in events.iter().chain(ev.iter()) { match event { events::MessageSendEvent::UpdateHTLCs { ref node_id, updates: CommitmentUpdate { ref update_add_htlcs, ref update_fail_htlcs, ref update_fulfill_htlcs, ref update_fail_malformed_htlcs, ref update_fee, ref commitment_signed } } => { for dest in nodes.iter() { @@ -661,7 +682,9 @@ pub fn do_test(data: &[u8], out: Out) { } } } - match get_slice!(1)[0] { + let a = get_slice!(1)[0]; + println!("PROCESSING {:x}", a); + match a { 0x00 => *monitor_a.update_ret.lock().unwrap() = Err(ChannelMonitorUpdateErr::TemporaryFailure), 0x01 => *monitor_b.update_ret.lock().unwrap() = Err(ChannelMonitorUpdateErr::TemporaryFailure), 0x02 => *monitor_c.update_ret.lock().unwrap() = Err(ChannelMonitorUpdateErr::TemporaryFailure),