Skip to content

Commit 21098e6

Browse files
committed
NIH the delegate macro
1 parent 4017a48 commit 21098e6

File tree

4 files changed

+155
-254
lines changed

4 files changed

+155
-254
lines changed

lightning/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rustdoc-args = ["--cfg", "docsrs"]
1717

1818
[features]
1919
# Internal test utilities exposed to other repo crates
20-
_test_utils = ["regex", "bitcoin/bitcoinconsensus", "lightning-types/_test_utils", "delegate"]
20+
_test_utils = ["regex", "bitcoin/bitcoinconsensus", "lightning-types/_test_utils"]
2121
_externalize_tests = ["inventory", "_test_utils"]
2222
# Allow signing of local transactions that may have been revoked or will be revoked, for functional testing (e.g. justice tx handling).
2323
# This is unsafe to use in production because it may result in the counterparty publishing taking our funds.
@@ -48,14 +48,12 @@ regex = { version = "1.5.6", optional = true }
4848
backtrace = { version = "0.3", optional = true }
4949

5050
libm = { version = "0.2", default-features = false }
51-
delegate = { version = "0.13.1", optional = true }
5251
inventory = { version = "0.3", optional = true }
5352

5453
[dev-dependencies]
5554
regex = "1.5.6"
5655
lightning-types = { version = "0.3.0", path = "../lightning-types", features = ["_test_utils"] }
5756
lightning-macros = { path = "../lightning-macros" }
58-
delegate = { version = "0.13.1" }
5957

6058
[dev-dependencies.bitcoin]
6159
version = "0.32.2"

lightning/src/ln/channel.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ impl<SP: Deref> Channel<SP> where
11871187
}
11881188
}
11891189

1190-
#[cfg(test)]
1190+
#[cfg(any(test, feature = "_externalize_tests"))]
11911191
pub fn funding_mut(&mut self) -> &mut FundingScope {
11921192
match &mut self.phase {
11931193
ChannelPhase::Undefined => unreachable!(),
@@ -1569,9 +1569,9 @@ pub(super) struct FundingScope {
15691569
/// minimum channel reserve for self to maintain - set by them.
15701570
counterparty_selected_channel_reserve_satoshis: Option<u64>,
15711571

1572-
#[cfg(test)]
1572+
#[cfg(any(test, feature = "_externalize_tests"))]
15731573
pub(super) holder_selected_channel_reserve_satoshis: u64,
1574-
#[cfg(not(test))]
1574+
#[cfg(not(any(test, feature = "_externalize_tests")))]
15751575
holder_selected_channel_reserve_satoshis: u64,
15761576

15771577
#[cfg(debug_assertions)]

0 commit comments

Comments
 (0)