use bitcoin::secp256k1::{self, PublicKey, Secp256k1, SecretKey};
+#[allow(unused_imports)]
+use crate::prelude::*;
+
use crate::blinded_path::{BlindedHop, BlindedPath};
use crate::blinded_path::utils;
use crate::io;
use crate::io::Cursor;
use crate::ln::onion_utils;
use crate::onion_message::packet::ControlTlvs;
-use crate::prelude::*;
use crate::sign::{NodeSigner, Recipient};
use crate::crypto::streams::ChaChaPolyReadAdapter;
use crate::util::ser::{FixedLengthReader, LengthReadableArgs, Writeable, Writer};
use crate::ln::features::BlindedHopFeatures;
use crate::ln::msgs::DecodeError;
use crate::offers::invoice::BlindedPayInfo;
-use crate::prelude::*;
use crate::util::ser::{HighZeroBytesDroppedBigSize, Readable, Writeable, Writer};
+#[allow(unused_imports)]
+use crate::prelude::*;
+
use core::convert::TryFrom;
/// An intermediate node, its outbound channel, and relay parameters.
use crate::util::ser::{Readable, Writeable};
use crate::io;
+
+#[allow(unused_imports)]
use crate::prelude::*;
// TODO: DRY with onion_utils::construct_onion_keys_callback
use crate::events::{ClosureReason, Event, EventHandler};
use crate::events::bump_transaction::{AnchorDescriptor, BumpTransactionEvent};
+#[allow(unused_imports)]
use crate::prelude::*;
+
use core::{cmp, mem};
use crate::io::{self, Error};
use core::convert::TryInto;
use crate::sync::{Arc, Mutex};
use crate::io;
use crate::ln::features::ChannelTypeFeatures;
+
+ #[allow(unused_imports)]
use crate::prelude::*;
use std::str::FromStr;
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::chain::transaction::{OutPoint, TransactionData};
+#[allow(unused_imports)]
use crate::prelude::*;
pub mod chaininterface;
use crate::util::ser::{Readable, Writer, Writeable, RequiredWrapper};
use crate::io;
-use crate::prelude::*;
use core::cmp;
use core::convert::TryInto;
use core::mem;
use core::ops::Deref;
+#[allow(unused_imports)]
+use crate::prelude::*;
+
use super::chaininterface::LowerBoundedFeeEstimator;
const MAX_ALLOC_SIZE: usize = 64*1024;
use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::secp256k1::PublicKey;
use crate::io;
-use crate::prelude::*;
use core::time::Duration;
use core::ops::Deref;
use crate::sync::Arc;
+#[allow(unused_imports)]
+use crate::prelude::*;
+
/// Some information provided on receipt of payment depends on whether the payment received is a
/// spontaneous payment or a "conventional" lightning payment that's paying an invoice.
#[derive(Clone, Debug, PartialEq, Eq)]
use bitcoin::PublicKey as BitcoinPublicKey;
use crate::io;
-use crate::prelude::*;
use core::cmp;
use crate::ln::chan_utils;
use crate::util::transaction_utils::sort_outputs;
use crate::crypto::utils::{sign, sign_with_aux_rand};
use super::channel_keys::{DelayedPaymentBasepoint, DelayedPaymentKey, HtlcKey, HtlcBasepoint, RevocationKey, RevocationBasepoint};
+#[allow(unused_imports)]
+use crate::prelude::*;
+
/// Maximum number of one-way in-flight HTLC (protocol-level value).
pub const MAX_HTLCS: u16 = 483;
/// The weight of a BIP141 witnessScript for a BOLT3's "offered HTLC output" on a commitment transaction, non-anchor variant.
mod tests {
use super::{CounterpartyCommitmentSecrets, ChannelPublicKeys};
use crate::chain;
- use crate::prelude::*;
use crate::ln::chan_utils::{get_htlc_redeemscript, get_to_countersignatory_with_anchors_redeemscript, CommitmentTransaction, TxCreationKeys, ChannelTransactionParameters, CounterpartyChannelTransactionParameters, HTLCOutputInCommitment};
use bitcoin::secp256k1::{PublicKey, SecretKey, Secp256k1};
use crate::util::test_utils;
use bitcoin::PublicKey as BitcoinPublicKey;
use crate::ln::features::ChannelTypeFeatures;
+ #[allow(unused_imports)]
+ use crate::prelude::*;
+
struct TestCommitmentTxBuilder {
commitment_number: u64,
holder_funding_pubkey: PublicKey,
//! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
//! [messages]: crate::ln::msgs
-use crate::{io, io_extras};
+#[allow(unused_imports)]
use crate::prelude::*;
+
+use crate::{io, io_extras};
use core::{cmp, fmt};
use core::borrow::Borrow;
use core::hash::{Hash, Hasher};
use crate::util::ser::{Readable, WithoutLength, Writeable, Writer};
mod sealed {
+ #[allow(unused_imports)]
use crate::prelude::*;
use crate::ln::features::Features;
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd)]
pub struct PaymentSecret(pub [u8; 32]);
+#[allow(unused_imports)]
use crate::prelude::*;
+
use bitcoin::bech32;
use bitcoin::bech32::{Base32Len, FromBase32, ToBase32, WriteBase32, u5};
use crate::onion_message;
use crate::sign::{NodeSigner, Recipient};
+#[allow(unused_imports)]
use crate::prelude::*;
+
#[cfg(feature = "std")]
use core::convert::TryFrom;
use core::fmt;
mod fuzzy_internal_msgs {
use bitcoin::secp256k1::PublicKey;
use crate::blinded_path::payment::{PaymentConstraints, PaymentRelay};
- use crate::prelude::*;
use crate::ln::{PaymentPreimage, PaymentSecret};
use crate::ln::features::BlindedHopFeatures;
use super::{FinalOnionHopData, TrampolineOnionPacket};
+ #[allow(unused_imports)]
+ use crate::prelude::*;
+
// These types aren't intended to be pub, but are exposed for direct fuzzing (as we deserialize
// them from untrusted input):
use crate::sign::{NodeSigner, Recipient};
use crate::util::logger::Logger;
+#[allow(unused_imports)]
use crate::prelude::*;
+
use core::ops::Deref;
/// Invalid inbound onion payment.
use bitcoin::secp256k1::{PublicKey, Scalar, Secp256k1, SecretKey};
use crate::io::{Cursor, Read};
-use crate::prelude::*;
use core::convert::{AsMut, TryInto};
use core::ops::Deref;
+#[allow(unused_imports)]
+use crate::prelude::*;
+
pub(crate) struct OnionKeys {
#[cfg(test)]
pub(crate) shared_secret: SharedSecret,
use crate::ln::features::{ChannelFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::PaymentHash;
- use crate::prelude::*;
use crate::routing::router::{Path, Route, RouteHop};
use crate::util::ser::{VecWriter, Writeable, Writer};
+ #[allow(unused_imports)]
+ use crate::prelude::*;
+
use bitcoin::hashes::hex::FromHex;
use bitcoin::secp256k1::Secp256k1;
use bitcoin::secp256k1::{PublicKey, SecretKey};
use crate::util::logger::{Level, Logger, WithContext};
use crate::util::string::PrintableString;
+#[allow(unused_imports)]
use crate::prelude::*;
+
use crate::io;
use alloc::collections::VecDeque;
use crate::sync::{Mutex, MutexGuard, FairRwLock};
use bitcoin::blockdata::constants::ChainHash;
use bitcoin::secp256k1::{PublicKey, SecretKey};
- use crate::prelude::*;
use crate::sync::{Arc, Mutex};
use core::convert::Infallible;
use core::sync::atomic::{AtomicBool, Ordering};
+ #[allow(unused_imports)]
+ use crate::prelude::*;
+
#[derive(Clone)]
struct FileDescriptor {
fd: u16,
-// This file is Copyright its original authors, visible in version control
+ // This file is Copyright its original authors, visible in version control
// history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
use crate::util::ser::{HighZeroBytesDroppedBigSize, Iterable, SeekReadable, WithoutLength, Writeable, Writer};
use crate::util::string::PrintableString;
+#[allow(unused_imports)]
use crate::prelude::*;
#[cfg(feature = "std")]
use crate::util::ser::{HighZeroBytesDroppedBigSize, Readable, WithoutLength, Writeable, Writer};
use crate::util::string::UntrustedString;
+#[allow(unused_imports)]
use crate::prelude::*;
/// An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
crate::offers::invoice::{InvoiceWithDerivedSigningPubkeyBuilder, InvoiceWithExplicitSigningPubkeyBuilder},
};
+#[allow(unused_imports)]
use crate::prelude::*;
/// Tag for the hash function used when signing an [`InvoiceRequest`]'s merkle root.
use crate::io;
use crate::util::ser::{BigSize, Readable, Writeable, Writer};
+#[allow(unused_imports)]
use crate::prelude::*;
/// Valid type range for signature TLV records.
crate::offers::invoice_request::{InvoiceRequestWithDerivedPayerIdBuilder, InvoiceRequestWithExplicitPayerIdBuilder},
};
+#[allow(unused_imports)]
use crate::prelude::*;
#[cfg(feature = "std")]
use crate::ln::msgs::DecodeError;
use crate::util::ser::SeekReadable;
+#[allow(unused_imports)]
use crate::prelude::*;
#[cfg(not(fuzzing))]
use core::fmt;
use super::Bolt12ParseError;
+ #[allow(unused_imports)]
use crate::prelude::*;
/// Indicates a message can be encoded using bech32.
use crate::offers::signer::Metadata;
use crate::util::ser::WithoutLength;
+#[allow(unused_imports)]
use crate::prelude::*;
/// An unpredictable sequence of bytes typically containing information needed to derive
crate::offers::invoice::{InvoiceWithDerivedSigningPubkeyBuilder, InvoiceWithExplicitSigningPubkeyBuilder},
};
+#[allow(unused_imports)]
use crate::prelude::*;
#[cfg(feature = "std")]
use bitcoin::secp256k1::{PublicKey,SecretKey};
use bitcoin::secp256k1::{Secp256k1, All};
+#[allow(unused)]
use crate::prelude::*;
use crate::sync::{self, Arc};
use crate::ln::chan_utils::{HTLCOutputInCommitment, HolderCommitmentTransaction, CommitmentTransaction, ClosingTransaction};
use crate::ln::msgs::UnsignedChannelAnnouncement;
+#[allow(unused_imports)]
use crate::prelude::*;
+
use crate::sign::{ChannelSigner, HTLCDescriptor};
/// A trait to sign Lightning channel transactions as described in
// Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or
// MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
-
+#[allow(unused)]
use crate::prelude::*;
/// RFC4648 encoding table
//! Low level invoice utilities.
use bitcoin::bech32::{u5, FromBase32};
+
+#[allow(unused)]
use crate::prelude::*;
/// Construct the invoice's HRP and signatureless data into a preimage to be hashed.
//! <https://lightning.readthedocs.io/lightning-signmessage.7.html>
//! <https://api.lightning.community/#signmessage>
+#[allow(unused)]
use crate::prelude::*;
use crate::util::base32;
use bitcoin::hashes::{sha256d, Hash};
#[cfg(test)]
mod tests {
- use crate::io::{self, Cursor};
+ #[allow(unused_imports)]
use crate::prelude::*;
+
+ use crate::io::{self, Cursor};
use crate::ln::msgs::DecodeError;
use crate::util::ser::{Writeable, HighZeroBytesDroppedBigSize, VecWriter};
use bitcoin::hashes::hex::FromHex;
use crate::sign::{InMemorySigner, ChannelSigner};
use crate::sign::ecdsa::{EcdsaChannelSigner, WriteableEcdsaChannelSigner};
+#[allow(unused_imports)]
use crate::prelude::*;
+
use core::cmp;
use crate::sync::{Mutex, Arc};
#[cfg(test)] use crate::sync::MutexGuard;
use crate::ln::msgs::MAX_VALUE_MSAT;
+#[allow(unused_imports)]
use crate::prelude::*;
+
use crate::io_extras::sink;
use core::cmp::Ordering;
use core::mem;
use crate::sync::Mutex;
+#[allow(unused_imports)]
use crate::prelude::*;
#[cfg(feature = "std")]