X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Ftest_utils.rs;h=d42a84d361d45a56ebb83933e66ff4fa34e10e4d;hb=0edd645ba88af59b06965805cde2e28dbc89cfc4;hp=5e69f76c4b5a1fea0aaf70a128343ede9c7a6784;hpb=54f96ef944423eac98d302fbc7cdcdc136d58312;p=rust-lightning diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index 5e69f76c..d42a84d3 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -94,8 +94,13 @@ pub struct TestFeeEstimator { pub sat_per_kw: Mutex, } impl chaininterface::FeeEstimator for TestFeeEstimator { - fn get_est_sat_per_1000_weight(&self, _confirmation_target: ConfirmationTarget) -> u32 { - *self.sat_per_kw.lock().unwrap() + fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32 { + match confirmation_target { + ConfirmationTarget::MaxAllowedNonAnchorChannelRemoteFee => { + core::cmp::max(25 * 250, *self.sat_per_kw.lock().unwrap() * 10) + } + _ => *self.sat_per_kw.lock().unwrap(), + } } } @@ -969,8 +974,10 @@ impl Logger for TestLogger { fn log(&self, record: &Record) { *self.lines.lock().unwrap().entry((record.module_path.to_string(), format!("{}", record.args))).or_insert(0) += 1; if record.level >= self.level { - #[cfg(all(not(ldk_bench), feature = "std"))] - println!("{:<5} {} [{} : {}, {}] {}", record.level.to_string(), self.id, record.module_path, record.file, record.line, record.args); + #[cfg(all(not(ldk_bench), feature = "std"))] { + let pfx = format!("{} {} [{}:{}]", self.id, record.level.to_string(), record.module_path, record.line); + println!("{:<55}{}", pfx, record.args); + } } } }