1- #![ cfg_attr( rustfmt, rustfmt_skip) ]
2-
31// This file is Copyright its original authors, visible in version control
42// history.
53//
@@ -189,25 +187,29 @@ pub const FEERATE_FLOOR_SATS_PER_KW: u32 = 253;
189187///
190188/// Note that this does *not* implement [`FeeEstimator`] to make it harder to accidentally mix the
191189/// two.
192- pub ( crate ) struct LowerBoundedFeeEstimator < F : Deref > ( pub F ) where F :: Target : FeeEstimator ;
193-
194- impl < F : Deref > LowerBoundedFeeEstimator < F > where F :: Target : FeeEstimator {
190+ pub ( crate ) struct LowerBoundedFeeEstimator < F : Deref > ( pub F )
191+ where
192+ F :: Target : FeeEstimator ;
193+
194+ impl < F : Deref > LowerBoundedFeeEstimator < F >
195+ where
196+ F :: Target : FeeEstimator ,
197+ {
195198 /// Creates a new `LowerBoundedFeeEstimator` which wraps the provided fee_estimator
196199 pub fn new ( fee_estimator : F ) -> Self {
197200 LowerBoundedFeeEstimator ( fee_estimator)
198201 }
199202
200203 pub fn bounded_sat_per_1000_weight ( & self , confirmation_target : ConfirmationTarget ) -> u32 {
201- cmp:: max (
202- self . 0 . get_est_sat_per_1000_weight ( confirmation_target) ,
203- FEERATE_FLOOR_SATS_PER_KW ,
204- )
204+ cmp:: max ( self . 0 . get_est_sat_per_1000_weight ( confirmation_target) , FEERATE_FLOOR_SATS_PER_KW )
205205 }
206206}
207207
208208#[ cfg( test) ]
209209mod tests {
210- use super :: { FEERATE_FLOOR_SATS_PER_KW , LowerBoundedFeeEstimator , ConfirmationTarget , FeeEstimator } ;
210+ use super :: {
211+ ConfirmationTarget , FeeEstimator , LowerBoundedFeeEstimator , FEERATE_FLOOR_SATS_PER_KW ,
212+ } ;
211213
212214 struct TestFeeEstimator {
213215 sat_per_kw : u32 ,
@@ -225,7 +227,10 @@ mod tests {
225227 let test_fee_estimator = & TestFeeEstimator { sat_per_kw } ;
226228 let fee_estimator = LowerBoundedFeeEstimator :: new ( test_fee_estimator) ;
227229
228- assert_eq ! ( fee_estimator. bounded_sat_per_1000_weight( ConfirmationTarget :: AnchorChannelFee ) , FEERATE_FLOOR_SATS_PER_KW ) ;
230+ assert_eq ! (
231+ fee_estimator. bounded_sat_per_1000_weight( ConfirmationTarget :: AnchorChannelFee ) ,
232+ FEERATE_FLOOR_SATS_PER_KW
233+ ) ;
229234 }
230235
231236 #[ test]
@@ -234,6 +239,9 @@ mod tests {
234239 let test_fee_estimator = & TestFeeEstimator { sat_per_kw } ;
235240 let fee_estimator = LowerBoundedFeeEstimator :: new ( test_fee_estimator) ;
236241
237- assert_eq ! ( fee_estimator. bounded_sat_per_1000_weight( ConfirmationTarget :: AnchorChannelFee ) , sat_per_kw) ;
242+ assert_eq ! (
243+ fee_estimator. bounded_sat_per_1000_weight( ConfirmationTarget :: AnchorChannelFee ) ,
244+ sat_per_kw
245+ ) ;
238246 }
239247}
0 commit comments