Skip to content

Commit da1588e

Browse files
committed
Update serialization field numbers for consistency
Leading up to the 0.1 release, we update the field numbers of `PaymentDetails` and `Event` to make them even. While this is nice for consistency's sake, it also has the added benefit that users running the serialization-incompatible alpha versions would fail to read rather than reading bogus data.
1 parent 68a5086 commit da1588e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/event.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,22 @@ impl_writeable_tlv_based_enum!(Event,
8787
},
8888
(2, PaymentReceived) => {
8989
(0, payment_hash, required),
90-
(1, amount_msat, required),
90+
(2, amount_msat, required),
9191
},
9292
(3, ChannelReady) => {
9393
(0, channel_id, required),
94-
(1, user_channel_id, required),
94+
(2, user_channel_id, required),
9595
},
9696
(4, ChannelPending) => {
9797
(0, channel_id, required),
98-
(1, user_channel_id, required),
99-
(2, former_temporary_channel_id, required),
100-
(3, counterparty_node_id, required),
101-
(4, funding_txo, required),
98+
(2, user_channel_id, required),
99+
(4, former_temporary_channel_id, required),
100+
(6, counterparty_node_id, required),
101+
(8, funding_txo, required),
102102
},
103103
(5, ChannelClosed) => {
104104
(0, channel_id, required),
105-
(1, user_channel_id, required),
105+
(2, user_channel_id, required),
106106
};
107107
);
108108

src/payment_store.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ pub struct PaymentDetails {
3131

3232
impl_writeable_tlv_based!(PaymentDetails, {
3333
(0, hash, required),
34-
(1, preimage, required),
35-
(2, secret, required),
36-
(3, amount_msat, required),
37-
(4, direction, required),
38-
(5, status, required)
34+
(2, preimage, required),
35+
(4, secret, required),
36+
(6, amount_msat, required),
37+
(8, direction, required),
38+
(10, status, required)
3939
});
4040

4141
/// Represents the direction of a payment.

0 commit comments

Comments
 (0)