1
- #![ cfg_attr( rustfmt, rustfmt_skip) ]
2
-
3
1
// This file is Copyright its original authors, visible in version control
4
2
// history.
5
3
//
@@ -189,14 +187,20 @@ pub const FEERATE_FLOOR_SATS_PER_KW: u32 = 253;
189
187
///
190
188
/// Note that this does *not* implement [`FeeEstimator`] to make it harder to accidentally mix the
191
189
/// 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
+ {
195
198
/// Creates a new `LowerBoundedFeeEstimator` which wraps the provided fee_estimator
196
199
pub fn new ( fee_estimator : F ) -> Self {
197
200
LowerBoundedFeeEstimator ( fee_estimator)
198
201
}
199
202
203
+ #[ rustfmt:: skip]
200
204
pub fn bounded_sat_per_1000_weight ( & self , confirmation_target : ConfirmationTarget ) -> u32 {
201
205
cmp:: max (
202
206
self . 0 . get_est_sat_per_1000_weight ( confirmation_target) ,
@@ -207,7 +211,9 @@ impl<F: Deref> LowerBoundedFeeEstimator<F> where F::Target: FeeEstimator {
207
211
208
212
#[ cfg( test) ]
209
213
mod tests {
210
- use super :: { FEERATE_FLOOR_SATS_PER_KW , LowerBoundedFeeEstimator , ConfirmationTarget , FeeEstimator } ;
214
+ use super :: {
215
+ ConfirmationTarget , FeeEstimator , LowerBoundedFeeEstimator , FEERATE_FLOOR_SATS_PER_KW ,
216
+ } ;
211
217
212
218
struct TestFeeEstimator {
213
219
sat_per_kw : u32 ,
@@ -220,6 +226,7 @@ mod tests {
220
226
}
221
227
222
228
#[ test]
229
+ #[ rustfmt:: skip]
223
230
fn test_fee_estimator_less_than_floor ( ) {
224
231
let sat_per_kw = FEERATE_FLOOR_SATS_PER_KW - 1 ;
225
232
let test_fee_estimator = & TestFeeEstimator { sat_per_kw } ;
@@ -229,6 +236,7 @@ mod tests {
229
236
}
230
237
231
238
#[ test]
239
+ #[ rustfmt:: skip]
232
240
fn test_fee_estimator_greater_than_floor ( ) {
233
241
let sat_per_kw = FEERATE_FLOOR_SATS_PER_KW + 1 ;
234
242
let test_fee_estimator = & TestFeeEstimator { sat_per_kw } ;
0 commit comments