Impl Base AMP in the receive pipeline and expose payment_secret
[rust-lightning] / fuzz / src / chanmon_consistency.rs
index 1a55ee79ce4f0c623a66cf20dccad0c4fd6f8d3f..1d549bf76308b2124cd979a1c339a7c841ea5175 100644 (file)
@@ -150,7 +150,7 @@ impl KeysInterface for KeyProvider {
                PublicKey::from_secret_key(&secp_ctx, &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, 3, self.node_id]).unwrap())
        }
 
-       fn get_channel_keys(&self, _inbound: bool) -> EnforcingChannelKeys {
+       fn get_channel_keys(&self, _inbound: bool, channel_value_satoshis: u64) -> EnforcingChannelKeys {
                EnforcingChannelKeys::new(InMemoryChannelKeys {
                        funding_key:               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, 4, self.node_id]).unwrap(),
                        revocation_base_key:       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, 5, self.node_id]).unwrap(),
@@ -159,6 +159,7 @@ impl KeysInterface for KeyProvider {
                        htlc_base_key:             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, 8, self.node_id]).unwrap(),
                        commitment_seed: [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, 9, self.node_id],
                        remote_channel_pubkeys: None,
+                       channel_value_satoshis,
                })
        }
 
@@ -420,7 +421,7 @@ pub fn do_test(data: &[u8]) {
                                                fee_msat: 5000000,
                                                cltv_expiry_delta: 200,
                                        }],
-                               }, PaymentHash(payment_hash.into_inner())) {
+                               }, PaymentHash(payment_hash.into_inner()), None) {
                                        // Probably ran out of funds
                                        test_return!();
                                }
@@ -444,7 +445,7 @@ pub fn do_test(data: &[u8]) {
                                                fee_msat: 5000000,
                                                cltv_expiry_delta: 200,
                                        }],
-                               }, PaymentHash(payment_hash.into_inner())) {
+                               }, PaymentHash(payment_hash.into_inner()), None) {
                                        // Probably ran out of funds
                                        test_return!();
                                }
@@ -605,9 +606,9 @@ pub fn do_test(data: &[u8]) {
                                                events::Event::PaymentReceived { payment_hash, .. } => {
                                                        if claim_set.insert(payment_hash.0) {
                                                                if $fail {
-                                                                       assert!(nodes[$node].fail_htlc_backwards(&payment_hash));
+                                                                       assert!(nodes[$node].fail_htlc_backwards(&payment_hash, &None));
                                                                } else {
-                                                                       assert!(nodes[$node].claim_funds(PaymentPreimage(payment_hash.0), 5_000_000));
+                                                                       assert!(nodes[$node].claim_funds(PaymentPreimage(payment_hash.0), &None, 5_000_000));
                                                                }
                                                        }
                                                },