Track and react to remote partial-claiming of pending claim request
[rust-lightning] / fuzz / fuzz_targets / full_stack_target.rs
index b6d07c406d0e36c885b428fad89641e8f77cfd27..5198cf40a9f4cfa99ce5d643a025e438f6dbde7c 100644 (file)
@@ -277,9 +277,10 @@ impl KeysInterface for KeyProvider {
                }
        }
 
-       fn get_session_key(&self) -> SecretKey {
+       fn get_onion_rand(&self) -> (SecretKey, [u8; 32]) {
                let ctr = self.counter.fetch_add(1, Ordering::Relaxed) as u8;
-               SecretKey::from_slice(&[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, 13, ctr]).unwrap()
+               (SecretKey::from_slice(&[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, 13, ctr]).unwrap(),
+               [0; 32])
        }
 
        fn get_channel_id(&self) -> [u8; 32] {
@@ -327,7 +328,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
        let monitor = channelmonitor::SimpleManyChannelMonitor::new(watch.clone(), broadcast.clone(), Arc::clone(&logger), fee_est.clone());
 
        let keys_manager = Arc::new(KeyProvider { node_secret: our_network_key.clone(), counter: AtomicU64::new(0) });
-       let mut config = UserConfig::new();
+       let mut config = UserConfig::default();
        config.channel_options.fee_proportional_millionths =  slice_to_be32(get_slice!(4));
        config.channel_options.announced_channel = get_slice!(1)[0] != 0;
        config.peer_channel_config_limits.min_dust_limit_satoshis = 0;
@@ -603,6 +604,8 @@ mod tests {
                // I.e 2nd inbound read, len 18 : 0006 (encrypted message length) + 03000000000000000000000000000000 (MAC of the encrypted message length)
                // Len 22 : 0010 00000000 (encrypted lightning message) + 03000000000000000000000000000000 (MAC of the Lightning message)
 
+               // Writing new code generating transactions and see a new failure ? Don't forget to add input for the FuzzEstimator !
+
                // 0000000000000000000000000000000000000000000000000000000000000000 - our network key
                // 00000000 - fee_proportional_millionths
                // 01 - announce_channels_publicly
@@ -864,7 +867,9 @@ mod tests {
                // 00fd - A feerate request (returning min feerate, which our open_channel also uses) (gonna be ingested by FuzzEstimator)
                // 0c005e - connect a block with one transaction of len 94
                // 0200000001fd00000000000000000000000000000000000000000000000000000000000000000000000000000000014f00000000000000220020f60000000000000000000000000000000000000000000000000000000000000000000000 - the funding transaction
+               // 00fd - A feerate request (returning min feerate, which our open_channel also uses) (gonna be ingested by FuzzEstimator)
                // 0c0000 - connect a block with no transactions
+               // 00fd - A feerate request (returning min feerate, which our open_channel also uses) (gonna be ingested by FuzzEstimator)
                // 0c0000 - connect a block with no transactions
                // 0c0000 - connect a block with no transactions
                // 0c0000 - connect a block with no transactions