]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Disambiguate ignorable and ignorable_option
authorValentine Wallace <vwallace@protonmail.com>
Mon, 20 Feb 2023 17:42:45 +0000 (12:42 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Fri, 24 Feb 2023 19:21:11 +0000 (14:21 -0500)
Would rather not rename ignorable to ignorable_required, so rename both of them
to upgradable_*

lightning/src/chain/channelmonitor.rs
lightning/src/chain/onchaintx.rs
lightning/src/ln/channelmanager.rs
lightning/src/routing/gossip.rs
lightning/src/util/events.rs
lightning/src/util/ser_macros.rs

index 509ebed6fbad3a6bc597838ec01b7dcb367c33f4..ea24f8cf61d1303a5959fa8e4c6d1aa63ce49cd3 100644 (file)
@@ -460,7 +460,7 @@ impl MaybeReadable for OnchainEventEntry {
                        (1, transaction, option),
                        (2, height, required),
                        (3, block_hash, option),
-                       (4, event, ignorable),
+                       (4, event, upgradable_required),
                });
                if let Some(ev) = event {
                        Ok(Some(Self { txid, transaction, height, block_hash, event: ev }))
index 039fb5ff13a04eb1fd843d061bbd992a0f394935..23140068a342731f97929371a7d2df0ec6ba2b42 100644 (file)
@@ -111,7 +111,7 @@ impl MaybeReadable for OnchainEventEntry {
                        (0, txid, required),
                        (1, block_hash, option),
                        (2, height, required),
-                       (4, event, ignorable),
+                       (4, event, upgradable_required),
                });
                if let Some(ev) = event {
                        Ok(Some(Self { txid, height, block_hash, event: ev }))
index 577e0984448a257a2ff9a23f305aa2684ef968dc..f659d63182b874f97e46b53e9755216ed8316a6d 100644 (file)
@@ -468,7 +468,7 @@ pub(crate) enum MonitorUpdateCompletionAction {
 
 impl_writeable_tlv_based_enum_upgradable!(MonitorUpdateCompletionAction,
        (0, PaymentClaimed) => { (0, payment_hash, required) },
-       (2, EmitEvent) => { (0, event, ignorable) },
+       (2, EmitEvent) => { (0, event, upgradable_required) },
 );
 
 /// State we hold per-peer.
index cf51b6ab52827943626ede2cbc5d0e87e1f95366..957be2951fc49562a60a798e83aa0e781ff6d353 100644 (file)
@@ -883,9 +883,9 @@ impl Readable for ChannelInfo {
                        (0, features, required),
                        (1, announcement_received_time, (default_value, 0)),
                        (2, node_one, required),
-                       (4, one_to_two_wrap, ignorable),
+                       (4, one_to_two_wrap, upgradable_required),
                        (6, node_two, required),
-                       (8, two_to_one_wrap, ignorable),
+                       (8, two_to_one_wrap, upgradable_required),
                        (10, capacity_sats, required),
                        (12, announcement_message, required),
                });
@@ -1161,7 +1161,7 @@ impl Readable for NodeInfo {
 
                read_tlv_fields!(reader, {
                        (0, _lowest_inbound_channel_fees, option),
-                       (2, announcement_info_wrap, ignorable),
+                       (2, announcement_info_wrap, upgradable_required),
                        (4, channels, vec_type),
                });
 
index 80ecc22842900fa428c5557723be59379a74d8ad..70bf07f958ebc9e34084784d3af29a5130c080a8 100644 (file)
@@ -1199,7 +1199,7 @@ impl MaybeReadable for Event {
                                        let mut payment_id = None;
                                        read_tlv_fields!(reader, {
                                                (0, payment_hash, required),
-                                               (1, network_update, ignorable),
+                                               (1, network_update, upgradable_required),
                                                (2, payment_failed_permanently, required),
                                                (5, path, vec_type),
                                                (7, short_channel_id, option),
@@ -1282,7 +1282,7 @@ impl MaybeReadable for Event {
                                        read_tlv_fields!(reader, {
                                                (0, channel_id, required),
                                                (1, user_channel_id_low_opt, option),
-                                               (2, reason, ignorable),
+                                               (2, reason, upgradable_required),
                                                (3, user_channel_id_high_opt, option),
                                        });
                                        if reason.is_none() { return Ok(None); }
@@ -1355,7 +1355,7 @@ impl MaybeReadable for Event {
                                        read_tlv_fields!(reader, {
                                                (0, payment_hash, required),
                                                (1, receiver_node_id, option),
-                                               (2, purpose, ignorable),
+                                               (2, purpose, upgradable_required),
                                                (4, amount_msat, required),
                                        });
                                        if purpose.is_none() { return Ok(None); }
@@ -1413,7 +1413,7 @@ impl MaybeReadable for Event {
                                        let mut failed_next_destination_opt = None;
                                        read_tlv_fields!(reader, {
                                                (0, prev_channel_id, required),
-                                               (2, failed_next_destination_opt, ignorable),
+                                               (2, failed_next_destination_opt, upgradable_required),
                                        });
                                        if let Some(failed_next_destination) = failed_next_destination_opt {
                                                Ok(Some(Event::HTLCHandlingFailed {
index c7dcc8701782e947697f4f97f09c79344db87514..3f4b7153a7fe7ae2e30bb0e344b19aaf28c3dec4 100644 (file)
@@ -39,10 +39,10 @@ macro_rules! _encode_tlv {
                        field.write($stream)?;
                }
        };
-       ($stream: expr, $type: expr, $field: expr, ignorable) => {
+       ($stream: expr, $type: expr, $field: expr, upgradable_required) => {
                $crate::_encode_tlv!($stream, $type, $field, required);
        };
-       ($stream: expr, $type: expr, $field: expr, ignorable_option) => {
+       ($stream: expr, $type: expr, $field: expr, upgradable_option) => {
                $crate::_encode_tlv!($stream, $type, $field, option);
        };
        ($stream: expr, $type: expr, $field: expr, (option, encoding: ($fieldty: ty, $encoding: ident))) => {
@@ -161,10 +161,10 @@ macro_rules! _get_varint_length_prefixed_tlv_length {
                        $len.0 += field_len;
                }
        };
-       ($len: expr, $type: expr, $field: expr, ignorable) => {
+       ($len: expr, $type: expr, $field: expr, upgradable_required) => {
                $crate::_get_varint_length_prefixed_tlv_length!($len, $type, $field, required);
        };
-       ($len: expr, $type: expr, $field: expr, ignorable_option) => {
+       ($len: expr, $type: expr, $field: expr, upgradable_option) => {
                $crate::_get_varint_length_prefixed_tlv_length!($len, $type, $field, option);
        };
 }
@@ -216,10 +216,10 @@ macro_rules! _check_decoded_tlv_order {
        ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, vec_type) => {{
                // no-op
        }};
-       ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, ignorable) => {{
+       ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, upgradable_required) => {{
                // no-op
        }};
-       ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, ignorable_option) => {{
+       ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, upgradable_option) => {{
                // no-op
        }};
        ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, (option: $trait: ident $(, $read_arg: expr)?)) => {{
@@ -258,10 +258,10 @@ macro_rules! _check_missing_tlv {
        ($last_seen_type: expr, $type: expr, $field: ident, option) => {{
                // no-op
        }};
-       ($last_seen_type: expr, $type: expr, $field: ident, ignorable) => {{
+       ($last_seen_type: expr, $type: expr, $field: ident, upgradable_required) => {{
                // no-op
        }};
-       ($last_seen_type: expr, $type: expr, $field: ident, ignorable_option) => {{
+       ($last_seen_type: expr, $type: expr, $field: ident, upgradable_option) => {{
                // no-op
        }};
        ($last_seen_type: expr, $type: expr, $field: ident, (option: $trait: ident $(, $read_arg: expr)?)) => {{
@@ -292,10 +292,10 @@ macro_rules! _decode_tlv {
        ($reader: expr, $field: ident, option) => {{
                $field = Some($crate::util::ser::Readable::read(&mut $reader)?);
        }};
-       ($reader: expr, $field: ident, ignorable) => {{
+       ($reader: expr, $field: ident, upgradable_required) => {{
                $field = $crate::util::ser::MaybeReadable::read(&mut $reader)?;
        }};
-       ($reader: expr, $field: ident, ignorable_option) => {{
+       ($reader: expr, $field: ident, upgradable_option) => {{
                $field = $crate::util::ser::MaybeReadable::read(&mut $reader)?;
        }};
        ($reader: expr, $field: ident, (option: $trait: ident $(, $read_arg: expr)?)) => {{
@@ -635,10 +635,10 @@ macro_rules! _init_tlv_based_struct_field {
        ($field: ident, option) => {
                $field
        };
-       ($field: ident, ignorable) => {
+       ($field: ident, upgradable_required) => {
                if $field.is_none() { return Ok(None); } else { $field.unwrap() }
        };
-       ($field: ident, ignorable_option) => {
+       ($field: ident, upgradable_option) => {
                $field
        };
        ($field: ident, required) => {
@@ -670,10 +670,10 @@ macro_rules! _init_tlv_field_var {
        ($field: ident, option) => {
                let mut $field = None;
        };
-       ($field: ident, ignorable) => {
+       ($field: ident, upgradable_required) => {
                let mut $field = None;
        };
-       ($field: ident, ignorable_option) => {
+       ($field: ident, upgradable_option) => {
                let mut $field = None;
        };
 }