Skip to content

Commit 09ba0ba

Browse files
committed
Only expose constants exposed for testing in cfg(test)
1 parent 3e726c4 commit 09ba0ba

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lightning/src/ln/channel.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,18 @@ pub const OUR_MAX_HTLCS: u16 = 50; //TODO
359359
/// on ice until the funding transaction gets more confirmations, but the LN protocol doesn't
360360
/// really allow for this, so instead we're stuck closing it out at that point.
361361
const UNCONF_THRESHOLD: u32 = 6;
362-
/// Exposing these two constants for use in test in ChannelMonitor
363-
pub const COMMITMENT_TX_BASE_WEIGHT: u64 = 724;
364-
pub const COMMITMENT_TX_WEIGHT_PER_HTLC: u64 = 172;
365362
const SPENDING_INPUT_FOR_A_OUTPUT_WEIGHT: u64 = 79; // prevout: 36, nSequence: 4, script len: 1, witness lengths: (3+1)/4, sig: 73/4, if-selector: 1, redeemScript: (6 ops + 2*33 pubkeys + 1*2 delay)/4
366363
const B_OUTPUT_PLUS_SPENDING_INPUT_WEIGHT: u64 = 104; // prevout: 40, nSequence: 4, script len: 1, witness lengths: 3/4, sig: 73/4, pubkey: 33/4, output: 31 (TODO: Wrong? Useless?)
364+
365+
#[cfg(not(test))]
366+
const COMMITMENT_TX_BASE_WEIGHT: u64 = 724;
367+
#[cfg(test)]
368+
pub const COMMITMENT_TX_BASE_WEIGHT: u64 = 724;
369+
#[cfg(not(test))]
370+
const COMMITMENT_TX_WEIGHT_PER_HTLC: u64 = 172;
371+
#[cfg(test)]
372+
pub const COMMITMENT_TX_WEIGHT_PER_HTLC: u64 = 172;
373+
367374
/// Maximmum `funding_satoshis` value, according to the BOLT #2 specification
368375
/// it's 2^24.
369376
pub const MAX_FUNDING_SATOSHIS: u64 = (1 << 24);

0 commit comments

Comments
 (0)