]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Make HTLCDescriptor writeable
authorDavid Caseria <david.caseria@river.com>
Tue, 12 Sep 2023 20:30:58 +0000 (16:30 -0400)
committerDavid Caseria <david.caseria@river.com>
Tue, 12 Sep 2023 20:30:58 +0000 (16:30 -0400)
lightning/src/events/bump_transaction.rs

index 4e7c3a224c29204d57d43220527ea9ba423b9620..2d44275abb5aa2288009c681e26df14e959a2ce1 100644 (file)
@@ -57,6 +57,12 @@ pub struct ChannelDerivationParameters {
        pub transaction_parameters: ChannelTransactionParameters,
 }
 
+impl_writeable_tlv_based!(ChannelDerivationParameters, {
+    (0, value_satoshis, required),
+    (2, keys_id, required),
+    (4, transaction_parameters, required),
+});
+
 /// A descriptor used to sign for a commitment transaction's anchor output.
 #[derive(Clone, Debug, PartialEq, Eq)]
 pub struct AnchorDescriptor {
@@ -139,6 +145,16 @@ pub struct HTLCDescriptor {
        pub counterparty_sig: Signature
 }
 
+impl_writeable_tlv_based!(HTLCDescriptor, {
+    (0, channel_derivation_parameters, required),
+    (2, commitment_txid, required),
+    (4, per_commitment_number, required),
+    (6, per_commitment_point, required),
+    (8, htlc, required),
+    (10, preimage, option),
+    (12, counterparty_sig, required),
+});
+
 impl HTLCDescriptor {
        /// Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
        /// being spent by the HTLC input in the HTLC transaction.