Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions lightning-liquidity/src/lsps1/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::lsps0::ser::{
use bitcoin::{Address, FeeRate, OutPoint};
use lightning::offers::offer::Offer;
use lightning::util::ser::{Readable, Writeable};
use lightning::{impl_writeable_tlv_based, impl_writeable_tlv_based_enum};
use lightning::{impl_ser_tlv_based, impl_ser_tlv_based_enum};
use lightning_invoice::Bolt11Invoice;

use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -145,7 +145,7 @@ pub struct LSPS1OrderParams {
pub announce_channel: bool,
}

impl_writeable_tlv_based!(LSPS1OrderParams, {
impl_ser_tlv_based!(LSPS1OrderParams, {
(0, lsp_balance_sat, required),
(2, client_balance_sat, required),
(4, required_channel_confirmations, required),
Expand Down Expand Up @@ -185,7 +185,7 @@ pub enum LSPS1OrderState {
Failed,
}

impl_writeable_tlv_based_enum!(LSPS1OrderState,
impl_ser_tlv_based_enum!(LSPS1OrderState,
(0, Created) => {},
(2, Completed) => {},
(4, Failed) => {}
Expand All @@ -202,7 +202,7 @@ pub struct LSPS1PaymentInfo {
pub onchain: Option<LSPS1OnchainPaymentInfo>,
}

impl_writeable_tlv_based!(LSPS1PaymentInfo, {
impl_ser_tlv_based!(LSPS1PaymentInfo, {
(0, bolt11, option),
(2, bolt12, option),
(4, onchain, option),
Expand All @@ -225,7 +225,7 @@ pub struct LSPS1Bolt11PaymentInfo {
pub invoice: Bolt11Invoice,
}

impl_writeable_tlv_based!(LSPS1Bolt11PaymentInfo, {
impl_ser_tlv_based!(LSPS1Bolt11PaymentInfo, {
(0, state, required),
(2, expires_at, required),
(4, fee_total_sat, required),
Expand All @@ -251,7 +251,7 @@ pub struct LSPS1Bolt12PaymentInfo {
pub offer: Offer,
}

impl_writeable_tlv_based!(LSPS1Bolt12PaymentInfo, {
impl_ser_tlv_based!(LSPS1Bolt12PaymentInfo, {
(0, state, required),
(2, expires_at, required),
(4, fee_total_sat, required),
Expand Down Expand Up @@ -290,7 +290,7 @@ pub struct LSPS1OnchainPaymentInfo {
pub refund_onchain_address: Option<Address>,
}

impl_writeable_tlv_based!(LSPS1OnchainPaymentInfo, {
impl_ser_tlv_based!(LSPS1OnchainPaymentInfo, {
(0, state, required),
(2, expires_at, required),
(4, fee_total_sat, required),
Expand Down Expand Up @@ -322,7 +322,7 @@ pub enum LSPS1PaymentState {
Refunded,
}

impl_writeable_tlv_based_enum!(LSPS1PaymentState,
impl_ser_tlv_based_enum!(LSPS1PaymentState,
(0, ExpectPayment) => {},
(2, Hold) => {},
(4, Paid) => {},
Expand All @@ -340,7 +340,7 @@ pub struct LSPS1ChannelInfo {
pub expires_at: LSPSDateTime,
}

impl_writeable_tlv_based!(LSPS1ChannelInfo, {
impl_ser_tlv_based!(LSPS1ChannelInfo, {
(0, funded_at, required),
(2, funding_outpoint, required),
(4, expires_at, required),
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/lsps1/peer_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::lsps0::ser::{LSPSDateTime, LSPSRequestId};
use crate::prelude::HashMap;

use lightning::util::hash_tables::new_hash_map;
use lightning::{impl_writeable_tlv_based, impl_writeable_tlv_based_enum};
use lightning::{impl_ser_tlv_based, impl_ser_tlv_based_enum};

use core::fmt;

Expand Down Expand Up @@ -251,7 +251,7 @@ impl ChannelOrderState {
}
}

impl_writeable_tlv_based_enum!(ChannelOrderState,
impl_ser_tlv_based_enum!(ChannelOrderState,
(0, ExpectingPayment) => {
(0, payment_details, required),
},
Expand Down Expand Up @@ -415,7 +415,7 @@ impl PeerState {
}
}

impl_writeable_tlv_based!(PeerState, {
impl_ser_tlv_based!(PeerState, {
(0, outbound_channels_by_order_id, required),
(_unused, pending_requests, (static_value, new_hash_map())),
(_unused, needs_persist, (static_value, false)),
Expand Down Expand Up @@ -491,7 +491,7 @@ impl ChannelOrder {
}
}

impl_writeable_tlv_based!(ChannelOrder, {
impl_ser_tlv_based!(ChannelOrder, {
(0, order_params, required),
(2, state, required),
(4, created_at, required),
Expand Down
4 changes: 2 additions & 2 deletions lightning-liquidity/src/lsps2/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use alloc::vec::Vec;

use bitcoin::secp256k1::PublicKey;

use lightning::impl_writeable_tlv_based_enum;
use lightning::impl_ser_tlv_based_enum;

/// An event which an LSPS2 client should take some action in response to.
#[derive(Clone, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -181,7 +181,7 @@ pub enum LSPS2ServiceEvent {
},
}

impl_writeable_tlv_based_enum!(LSPS2ServiceEvent,
impl_ser_tlv_based_enum!(LSPS2ServiceEvent,
(0, GetInfo) => {
(0, request_id, required),
(2, counterparty_node_id, required),
Expand Down
4 changes: 2 additions & 2 deletions lightning-liquidity/src/lsps2/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use bitcoin::secp256k1::PublicKey;

use serde::{Deserialize, Serialize};

use lightning::impl_writeable_tlv_based;
use lightning::impl_ser_tlv_based;
use lightning::util::scid_utils;

use crate::lsps0::ser::{
Expand Down Expand Up @@ -123,7 +123,7 @@ pub struct LSPS2OpeningFeeParams {
pub promise: String,
}

impl_writeable_tlv_based!(LSPS2OpeningFeeParams, {
impl_ser_tlv_based!(LSPS2OpeningFeeParams, {
(0, min_fee_msat, required),
(2, proportional, required),
(4, valid_until, required),
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/lsps2/payment_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use alloc::vec::Vec;

use lightning::impl_writeable_tlv_based;
use lightning::impl_ser_tlv_based;
use lightning::ln::channelmanager::InterceptId;
use lightning_types::payment::PaymentHash;

Expand Down Expand Up @@ -63,7 +63,7 @@ impl PaymentQueue {
}
}

impl_writeable_tlv_based!(PaymentQueue, {
impl_ser_tlv_based!(PaymentQueue, {
(0, payments, optional_vec),
});

Expand All @@ -73,7 +73,7 @@ pub(crate) struct PaymentQueueEntry {
pub(crate) htlcs: Vec<InterceptedHTLC>,
}

impl_writeable_tlv_based!(PaymentQueueEntry, {
impl_ser_tlv_based!(PaymentQueueEntry, {
(0, payment_hash, required),
(2, htlcs, optional_vec),
});
Expand All @@ -85,7 +85,7 @@ pub(crate) struct InterceptedHTLC {
pub(crate) payment_hash: PaymentHash,
}

impl_writeable_tlv_based!(InterceptedHTLC, {
impl_ser_tlv_based!(InterceptedHTLC, {
(0, intercept_id, required),
(2, expected_outbound_amount_msat, required),
(4, payment_hash, required),
Expand Down
10 changes: 5 additions & 5 deletions lightning-liquidity/src/lsps2/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use lightning::ln::types::ChannelId;
use lightning::util::errors::APIError;
use lightning::util::logger::Level;
use lightning::util::ser::Writeable;
use lightning::{impl_writeable_tlv_based, impl_writeable_tlv_based_enum};
use lightning::{impl_ser_tlv_based, impl_ser_tlv_based_enum};

use lightning_types::payment::PaymentHash;

Expand Down Expand Up @@ -181,7 +181,7 @@ impl TrustModel {
}
}

impl_writeable_tlv_based_enum!(TrustModel,
impl_ser_tlv_based_enum!(TrustModel,
(0, ClientTrustsLsp) => {
(0, funding_tx_broadcast_safe, required),
(2, funding_tx, option),
Expand Down Expand Up @@ -468,7 +468,7 @@ impl OutboundJITChannelState {
}
}

impl_writeable_tlv_based_enum!(OutboundJITChannelState,
impl_ser_tlv_based_enum!(OutboundJITChannelState,
(0, PendingInitialPayment) => {
(0, payment_queue, required),
},
Expand Down Expand Up @@ -499,7 +499,7 @@ struct OutboundJITChannel {
trust_model: TrustModel,
}

impl_writeable_tlv_based!(OutboundJITChannel, {
impl_ser_tlv_based!(OutboundJITChannel, {
(0, state, required),
(2, user_channel_id, required),
(4, opening_fee_params, required),
Expand Down Expand Up @@ -660,7 +660,7 @@ impl PeerState {
}
}

impl_writeable_tlv_based!(PeerState, {
impl_ser_tlv_based!(PeerState, {
(0, outbound_channels_by_intercept_scid, required),
(2, intercept_scid_by_user_channel_id, required),
(4, intercept_scid_by_channel_id, required),
Expand Down
4 changes: 2 additions & 2 deletions lightning-liquidity/src/lsps5/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use alloc::string::String;
use alloc::vec::Vec;
use bitcoin::secp256k1::PublicKey;

use lightning::impl_writeable_tlv_based_enum;
use lightning::impl_ser_tlv_based_enum;

use super::msgs::LSPS5AppName;
use super::msgs::LSPS5Error;
Expand Down Expand Up @@ -76,7 +76,7 @@ pub enum LSPS5ServiceEvent {
},
}

impl_writeable_tlv_based_enum!(LSPS5ServiceEvent,
impl_ser_tlv_based_enum!(LSPS5ServiceEvent,
(0, SendWebhookNotification) => {
(0, counterparty_node_id, required),
(2, app_name, required),
Expand Down
6 changes: 3 additions & 3 deletions lightning-liquidity/src/lsps5/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use super::url_utils::LSPSUrl;

use lightning::ln::msgs::DecodeError;
use lightning::util::ser::{Readable, Writeable};
use lightning::{impl_writeable_tlv_based, impl_writeable_tlv_based_enum};
use lightning::{impl_ser_tlv_based, impl_ser_tlv_based_enum};
use lightning_types::string::UntrustedString;

use serde::de::{self, Deserializer, MapAccess, Visitor};
Expand Down Expand Up @@ -527,7 +527,7 @@ pub enum WebhookNotificationMethod {
LSPS5OnionMessageIncoming,
}

impl_writeable_tlv_based_enum!(WebhookNotificationMethod,
impl_ser_tlv_based_enum!(WebhookNotificationMethod,
(0, LSPS5WebhookRegistered) => {},
(2, LSPS5PaymentIncoming) => {},
(4, LSPS5ExpirySoon) => {
Expand Down Expand Up @@ -688,7 +688,7 @@ impl<'de> Deserialize<'de> for WebhookNotification {
}
}

impl_writeable_tlv_based!(WebhookNotification, {
impl_ser_tlv_based!(WebhookNotification, {
(0, method, required),
});

Expand Down
6 changes: 3 additions & 3 deletions lightning-liquidity/src/lsps5/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::utils::time::TimeProvider;

use bitcoin::secp256k1::PublicKey;

use lightning::impl_writeable_tlv_based;
use lightning::impl_ser_tlv_based;
use lightning::ln::channelmanager::AChannelManager;
use lightning::ln::msgs::{ErrorAction, LightningError};
use lightning::sign::NodeSigner;
Expand Down Expand Up @@ -66,7 +66,7 @@ struct Webhook {
last_notification_sent: Option<LSPSDateTime>,
}

impl_writeable_tlv_based!(Webhook, {
impl_ser_tlv_based!(Webhook, {
(0, _app_name, required),
(2, url, required),
(4, _counterparty_node_id, required),
Expand Down Expand Up @@ -834,7 +834,7 @@ impl Default for PeerState {
}
}

impl_writeable_tlv_based!(PeerState, {
impl_ser_tlv_based!(PeerState, {
(0, webhooks, required_vec),
(_unused, needs_persist, (static_value, false)),
});
8 changes: 4 additions & 4 deletions lightning/src/blinded_path/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ pub enum AsyncPaymentsContext {
},
}

impl_writeable_tlv_based_enum!(MessageContext,
impl_ser_tlv_based_enum!(MessageContext,
{0, Offers} => (),
{1, Custom} => (),
{2, AsyncPayments} => (),
Expand All @@ -671,7 +671,7 @@ impl_writeable_tlv_based_enum!(MessageContext,
// introduction of `ReceiveAuthKey`-based authentication for inbound `BlindedMessagePath`s. Because
// we do not support receiving to those contexts anymore (they will fail the `ReceiveAuthKey`-based
// authentication checks), we can reuse those fields here.
impl_writeable_tlv_based_enum!(OffersContext,
impl_ser_tlv_based_enum!(OffersContext,
(0, InvoiceRequest) => {
(0, nonce, required),
(1, payment_metadata, (option, encoding: (BTreeMap<u64, Vec<u8>>, BigSizeKeyedMap))),
Expand All @@ -694,7 +694,7 @@ impl_writeable_tlv_based_enum!(OffersContext,
},
);

impl_writeable_tlv_based_enum!(AsyncPaymentsContext,
impl_ser_tlv_based_enum!(AsyncPaymentsContext,
(0, OutboundPayment) => {
(0, payment_id, required),
},
Expand Down Expand Up @@ -737,7 +737,7 @@ pub struct DNSResolverContext {
pub nonce: [u8; 16],
}

impl_writeable_tlv_based!(DNSResolverContext, {
impl_ser_tlv_based!(DNSResolverContext, {
(0, nonce, required),
});

Expand Down
8 changes: 4 additions & 4 deletions lightning/src/blinded_path/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ impl Readable for PaymentConstraints {
}
}

impl_writeable_tlv_based_enum_legacy!(PaymentContext,
impl_ser_tlv_based_enum_legacy!(PaymentContext,
;
// 0 for Unknown removed in version 0.1.
(1, Bolt12Offer),
Expand All @@ -1108,18 +1108,18 @@ impl<'a> Writeable for PaymentContextRef<'a> {
}
}

impl_writeable_tlv_based!(Bolt12OfferContext, {
impl_ser_tlv_based!(Bolt12OfferContext, {
(0, offer_id, required),
(1, payment_metadata, (option, encoding: (BTreeMap<u64, Vec<u8>>, BigSizeKeyedMap))),
(2, invoice_request, required),
});

impl_writeable_tlv_based!(AsyncBolt12OfferContext, {
impl_ser_tlv_based!(AsyncBolt12OfferContext, {
(0, offer_nonce, required),
(1, payment_metadata, (option, encoding: (BTreeMap<u64, Vec<u8>>, BigSizeKeyedMap))),
});

impl_writeable_tlv_based!(Bolt12RefundContext, {
impl_ser_tlv_based!(Bolt12RefundContext, {
(1, payment_metadata, (option, encoding: (BTreeMap<u64, Vec<u8>>, BigSizeKeyedMap))),
});

Expand Down
6 changes: 3 additions & 3 deletions lightning/src/chain/chaininterface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,19 @@ pub enum FundingPurpose {

// Needed so downstream consumers can persist these without needing to define wrapper types
// mirroring the type structure.
impl_writeable_tlv_based!(FundingCandidate, {
impl_ser_tlv_based!(FundingCandidate, {
(1, txid, required),
(3, channels, required_vec),
});

impl_writeable_tlv_based!(ChannelFunding, {
impl_ser_tlv_based!(ChannelFunding, {
(1, counterparty_node_id, required),
(3, channel_id, required),
(5, purpose, required),
(7, contribution, option),
});

impl_writeable_tlv_based_enum!(FundingPurpose,
impl_ser_tlv_based_enum!(FundingPurpose,
(0, Establishment) => {},
(2, Splice) => {},
);
Expand Down
Loading
Loading