X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Ffull_stack.rs;h=85e6e5156a23d893bcf71c3f5d6329a1d83603dd;hb=5e968114b64034029282e4ac81b2275e4744c7ed;hp=65437cf52ff517e365d0ad22d8cf6dc197aa31e5;hpb=5a1404809fcf2548924b0a7c0d7be73f24e59e09;p=rust-lightning diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs index 65437cf52..85e6e5156 100644 --- a/fuzz/src/full_stack.rs +++ b/fuzz/src/full_stack.rs @@ -371,7 +371,7 @@ pub fn do_test(data: &[u8], logger: &Arc) { }, our_network_key, &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0], Arc::clone(&logger))); let mut should_forward = false; - let mut payments_received: Vec<(PaymentHash, u64)> = Vec::new(); + let mut payments_received: Vec = Vec::new(); let mut payments_sent = 0; let mut pending_funding_generation: Vec<([u8; 32], u64, Script)> = Vec::new(); let mut pending_funding_signatures = HashMap::new(); @@ -476,7 +476,7 @@ pub fn do_test(data: &[u8], logger: &Arc) { } }, 8 => { - for (payment, amt) in payments_received.drain(..) { + for payment in payments_received.drain(..) { // SHA256 is defined as XOR of all input bytes placed in the first byte, and 0s // for the remaining bytes. Thus, if not all remaining bytes are 0s we cannot // fulfill this HTLC, but if they are, we can just take the first byte and @@ -486,7 +486,7 @@ pub fn do_test(data: &[u8], logger: &Arc) { } else { let mut payment_preimage = PaymentPreimage([0; 32]); payment_preimage.0[0] = payment.0[0]; - channelmanager.claim_funds(payment_preimage, amt); + channelmanager.claim_funds(payment_preimage); } } }, @@ -500,7 +500,7 @@ pub fn do_test(data: &[u8], logger: &Arc) { let _ = channelmanager.create_inbound_payment_for_hash(payment_hash, None, 1, 0); }, 9 => { - for (payment, _) in payments_received.drain(..) { + for payment in payments_received.drain(..) { channelmanager.fail_htlc_backwards(&payment); } }, @@ -580,9 +580,9 @@ pub fn do_test(data: &[u8], logger: &Arc) { Event::FundingGenerationReady { temporary_channel_id, channel_value_satoshis, output_script, .. } => { pending_funding_generation.push((temporary_channel_id, channel_value_satoshis, output_script)); }, - Event::PaymentReceived { payment_hash, payment_secret: _, amt, user_payment_id: _ } => { + Event::PaymentReceived { payment_hash, .. } => { //TODO: enhance by fetching random amounts from fuzz input? - payments_received.push((payment_hash, amt)); + payments_received.push(payment_hash); }, Event::PaymentSent {..} => {}, Event::PaymentFailed {..} => {},