Skip to content

Commit f65de4c

Browse files
committed
Drop SerialId type as bindings don't support primitive aliasing
1 parent 92eefae commit f65de4c

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

lightning/src/ln/interactivetxs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ use crate::ln::chan_utils::{
3434
use crate::ln::channel::{FundingNegotiationContext, TOTAL_BITCOIN_SUPPLY_SATOSHIS};
3535
use crate::ln::funding::FundingTxInput;
3636
use crate::ln::msgs;
37-
use crate::ln::msgs::{MessageSendEvent, SerialId, TxSignatures};
37+
use crate::ln::msgs::{MessageSendEvent, TxSignatures};
3838
use crate::ln::types::ChannelId;
39+
type SerialId = u64;
3940
use crate::sign::{EntropySource, P2TR_KEY_PATH_WITNESS_WEIGHT, P2WPKH_WITNESS_WEIGHT};
4041

4142
use core::fmt::Display;

lightning/src/ln/msgs.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,6 @@ pub struct ChannelReady {
450450
pub short_channel_id_alias: Option<u64>,
451451
}
452452

453-
/// A randomly chosen number that is used to identify inputs within an interactive transaction
454-
/// construction.
455-
pub type SerialId = u64;
456-
457453
/// An `stfu` (quiescence) message to be sent by or received from the stfu initiator.
458454
///
459455
// TODO(splicing): Add spec link for `stfu`; still in draft, using from https://github.com/lightning/bolts/pull/1160
@@ -521,7 +517,7 @@ pub struct TxAddInput {
521517
pub channel_id: ChannelId,
522518
/// A randomly chosen unique identifier for this input, which is even for initiators and odd for
523519
/// non-initiators.
524-
pub serial_id: SerialId,
520+
pub serial_id: u64,
525521
/// Serialized transaction that contains the output this input spends to verify that it is
526522
/// non-malleable. Omitted for shared input.
527523
pub prevtx: Option<Transaction>,
@@ -542,7 +538,7 @@ pub struct TxAddOutput {
542538
pub channel_id: ChannelId,
543539
/// A randomly chosen unique identifier for this output, which is even for initiators and odd for
544540
/// non-initiators.
545-
pub serial_id: SerialId,
541+
pub serial_id: u64,
546542
/// The satoshi value of the output
547543
pub sats: u64,
548544
/// The scriptPubKey for the output
@@ -557,7 +553,7 @@ pub struct TxRemoveInput {
557553
/// The channel ID
558554
pub channel_id: ChannelId,
559555
/// The serial ID of the input to be removed
560-
pub serial_id: SerialId,
556+
pub serial_id: u64,
561557
}
562558

563559
/// A [`tx_remove_output`] message for removing an output during interactive transaction construction.
@@ -568,7 +564,7 @@ pub struct TxRemoveOutput {
568564
/// The channel ID
569565
pub channel_id: ChannelId,
570566
/// The serial ID of the output to be removed
571-
pub serial_id: SerialId,
567+
pub serial_id: u64,
572568
}
573569

574570
/// [`A tx_complete`] message signalling the conclusion of a peer's transaction contributions during
@@ -2848,7 +2844,7 @@ impl Writeable for TxAddInput {
28482844
impl LengthReadable for TxAddInput {
28492845
fn read_from_fixed_length_buffer<R: LengthLimitedRead>(r: &mut R) -> Result<Self, DecodeError> {
28502846
let channel_id: ChannelId = Readable::read(r)?;
2851-
let serial_id: SerialId = Readable::read(r)?;
2847+
let serial_id: u64 = Readable::read(r)?;
28522848

28532849
let prevtx_len: u16 = Readable::read(r)?;
28542850
let prevtx = if prevtx_len > 0 {

lightning/src/util/ser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use dnssec_prover::rr::Name;
4848
use crate::chain::ClaimId;
4949
#[cfg(taproot)]
5050
use crate::ln::msgs::PartialSignatureWithNonce;
51-
use crate::ln::msgs::{DecodeError, SerialId};
51+
use crate::ln::msgs::DecodeError;
5252
use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
5353
use crate::types::string::UntrustedString;
5454
use crate::util::byte_utils::{be48_to_array, slice_to_be48};
@@ -1089,7 +1089,7 @@ impl_for_vec!(crate::ln::channelmanager::MonitorUpdateCompletionAction);
10891089
impl_for_vec!(crate::ln::channelmanager::PaymentClaimDetails);
10901090
impl_for_vec!(crate::ln::msgs::SocketAddress);
10911091
impl_for_vec!((A, B), A, B);
1092-
impl_for_vec!(SerialId);
1092+
impl_for_vec!(u64);
10931093
impl_for_vec!(TxInMetadata);
10941094
impl_for_vec!(TxOutMetadata);
10951095
impl_for_vec!(crate::ln::our_peer_storage::PeerStorageMonitorHolder);

0 commit comments

Comments
 (0)