From 4363f965d6da2b5252b3e2fef09354b8970a9fe1 Mon Sep 17 00:00:00 2001 From: Antoine Riard Date: Sun, 18 Apr 2021 19:18:30 -0400 Subject: [PATCH] Move onchain* to chain/ --- lightning/src/chain/channelmonitor.rs | 8 +++----- lightning/src/chain/mod.rs | 2 ++ lightning/src/{ln => chain}/onchaintx.rs | 4 ++-- lightning/src/{ln => chain}/package.rs | 2 +- lightning/src/ln/mod.rs | 2 -- 5 files changed, 8 insertions(+), 10 deletions(-) rename lightning/src/{ln => chain}/onchaintx.rs (99%) rename lightning/src/{ln => chain}/package.rs (99%) diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index f12c4fea6..de8268141 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -38,13 +38,13 @@ use ln::msgs::DecodeError; use ln::chan_utils; use ln::chan_utils::{CounterpartyCommitmentSecrets, HTLCOutputInCommitment, HTLCType, ChannelTransactionParameters, HolderCommitmentTransaction}; use ln::channelmanager::{BestBlock, HTLCSource}; -use ln::onchaintx::OnchainTxHandler; -use ln::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderFundingOutput, HolderHTLCOutput, PackageSolvingData, PackageTemplate, RevokedOutput, RevokedHTLCOutput}; use chain; use chain::WatchedOutput; use chain::chaininterface::{BroadcasterInterface, FeeEstimator}; use chain::transaction::{OutPoint, TransactionData}; use chain::keysinterface::{SpendableOutputDescriptor, StaticPaymentOutputDescriptor, DelayedPaymentOutputDescriptor, Sign, KeysInterface}; +use chain::onchaintx::OnchainTxHandler; +use chain::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderFundingOutput, HolderHTLCOutput, PackageSolvingData, PackageTemplate, RevokedOutput, RevokedHTLCOutput}; use chain::Filter; use util::logger::Logger; use util::ser::{Readable, ReadableArgs, MaybeReadable, Writer, Writeable, U48}; @@ -2900,12 +2900,10 @@ mod tests { use bitcoin::network::constants::Network; use hex; use chain::channelmonitor::ChannelMonitor; - use chain::onchain_utils::{WEIGHT_OFFERED_HTLC, WEIGHT_RECEIVED_HTLC, WEIGHT_REVOKED_OFFERED_HTLC, WEIGHT_REVOKED_RECEIVED_HTLC, WEIGHT_REVOKED_OUTPUT}; + use chain::package::{WEIGHT_OFFERED_HTLC, WEIGHT_RECEIVED_HTLC, WEIGHT_REVOKED_OFFERED_HTLC, WEIGHT_REVOKED_RECEIVED_HTLC, WEIGHT_REVOKED_OUTPUT}; use chain::transaction::OutPoint; use ln::{PaymentPreimage, PaymentHash}; use ln::channelmanager::BestBlock; - use ln::package; - use ln::package::InputDescriptors; use ln::chan_utils; use ln::chan_utils::{HTLCOutputInCommitment, ChannelPublicKeys, ChannelTransactionParameters, HolderCommitmentTransaction, CounterpartyChannelTransactionParameters}; use util::test_utils::{TestLogger, TestBroadcaster, TestFeeEstimator}; diff --git a/lightning/src/chain/mod.rs b/lightning/src/chain/mod.rs index 42c74da13..856a9e8af 100644 --- a/lightning/src/chain/mod.rs +++ b/lightning/src/chain/mod.rs @@ -23,6 +23,8 @@ pub mod chainmonitor; pub mod channelmonitor; pub mod transaction; pub mod keysinterface; +pub(crate) mod onchaintx; +pub(crate) mod package; /// An error when accessing the chain via [`Access`]. #[derive(Clone)] diff --git a/lightning/src/ln/onchaintx.rs b/lightning/src/chain/onchaintx.rs similarity index 99% rename from lightning/src/ln/onchaintx.rs rename to lightning/src/chain/onchaintx.rs index 65fedecd9..131caff7a 100644 --- a/lightning/src/ln/onchaintx.rs +++ b/lightning/src/chain/onchaintx.rs @@ -24,11 +24,11 @@ use bitcoin::secp256k1; use ln::msgs::DecodeError; use ln::PaymentPreimage; use ln::chan_utils::{ChannelTransactionParameters, HolderCommitmentTransaction}; -use ln::package; -use ln::package::PackageTemplate; use chain::chaininterface::{FeeEstimator, BroadcasterInterface}; use chain::channelmonitor::{ANTI_REORG_DELAY, CLTV_SHARED_CLAIM_BUFFER}; use chain::keysinterface::{Sign, KeysInterface}; +use chain::package::PackageTemplate; +use chain::package; use util::logger::Logger; use util::ser::{Readable, ReadableArgs, Writer, Writeable, VecWriter}; use util::byte_utils; diff --git a/lightning/src/ln/package.rs b/lightning/src/chain/package.rs similarity index 99% rename from lightning/src/ln/package.rs rename to lightning/src/chain/package.rs index 220a3df14..49a01ebff 100644 --- a/lightning/src/ln/package.rs +++ b/lightning/src/chain/package.rs @@ -24,9 +24,9 @@ use ln::PaymentPreimage; use ln::chan_utils::{TxCreationKeys, HTLCOutputInCommitment, HTLC_OUTPUT_IN_COMMITMENT_SIZE}; use ln::chan_utils; use ln::msgs::DecodeError; -use ln::onchaintx::OnchainTxHandler; use chain::chaininterface::{FeeEstimator, ConfirmationTarget, MIN_RELAY_FEE_SAT_PER_1000_WEIGHT}; use chain::keysinterface::Sign; +use chain::onchaintx::OnchainTxHandler; use util::byte_utils; use util::logger::Logger; use util::ser::{Readable, Writer, Writeable}; diff --git a/lightning/src/ln/mod.rs b/lightning/src/ln/mod.rs index e7123e0e2..3de0595d2 100644 --- a/lightning/src/ln/mod.rs +++ b/lightning/src/ln/mod.rs @@ -27,8 +27,6 @@ pub mod msgs; pub mod peer_handler; pub mod chan_utils; pub mod features; -pub mod onchaintx; -pub mod package; #[cfg(feature = "fuzztarget")] pub mod peer_channel_encryptor; -- 2.39.5