]> git.bitcoin.ninja Git - rust-lightning/commitdiff
TESTING
authorMatt Corallo <git@bluematt.me>
Thu, 7 Mar 2019 16:33:19 +0000 (11:33 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 25 May 2020 19:36:59 +0000 (15:36 -0400)
fuzz/src/chanmon_consistency.rs

index e9f56a3e4605426881b442e580ef04ef8c5f9b97..5edc680c223b179b0e4e4b3c986cd9127e2f476e 100644 (file)
@@ -499,7 +499,28 @@ pub fn do_test<Out: test_logger::Output>(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<Out: test_logger::Output>(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),