@@ -187,25 +187,29 @@ pub const FEERATE_FLOOR_SATS_PER_KW: u32 = 253;
187
187
///
188
188
/// Note that this does *not* implement [`FeeEstimator`] to make it harder to accidentally mix the
189
189
/// two.
190
- pub ( crate ) struct LowerBoundedFeeEstimator < F : Deref > ( pub F ) where F :: Target : FeeEstimator ;
191
-
192
- 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
+ {
193
198
/// Creates a new `LowerBoundedFeeEstimator` which wraps the provided fee_estimator
194
199
pub fn new ( fee_estimator : F ) -> Self {
195
200
LowerBoundedFeeEstimator ( fee_estimator)
196
201
}
197
202
198
203
pub fn bounded_sat_per_1000_weight ( & self , confirmation_target : ConfirmationTarget ) -> u32 {
199
- cmp:: max (
200
- self . 0 . get_est_sat_per_1000_weight ( confirmation_target) ,
201
- FEERATE_FLOOR_SATS_PER_KW ,
202
- )
204
+ cmp:: max ( self . 0 . get_est_sat_per_1000_weight ( confirmation_target) , FEERATE_FLOOR_SATS_PER_KW )
203
205
}
204
206
}
205
207
206
208
#[ cfg( test) ]
207
209
mod tests {
208
- use super :: { FEERATE_FLOOR_SATS_PER_KW , LowerBoundedFeeEstimator , ConfirmationTarget , FeeEstimator } ;
210
+ use super :: {
211
+ ConfirmationTarget , FeeEstimator , LowerBoundedFeeEstimator , FEERATE_FLOOR_SATS_PER_KW ,
212
+ } ;
209
213
210
214
struct TestFeeEstimator {
211
215
sat_per_kw : u32 ,
@@ -223,7 +227,10 @@ mod tests {
223
227
let test_fee_estimator = & TestFeeEstimator { sat_per_kw } ;
224
228
let fee_estimator = LowerBoundedFeeEstimator :: new ( test_fee_estimator) ;
225
229
226
- 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
+ ) ;
227
234
}
228
235
229
236
#[ test]
@@ -232,6 +239,9 @@ mod tests {
232
239
let test_fee_estimator = & TestFeeEstimator { sat_per_kw } ;
233
240
let fee_estimator = LowerBoundedFeeEstimator :: new ( test_fee_estimator) ;
234
241
235
- 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
+ ) ;
236
246
}
237
247
}
0 commit comments