Skip to content

Commit 1b9bbe5

Browse files
authored
Merge pull request #405 from TheBlueMatt/2019-11-cleanups
Misc Cleanups
2 parents 7591eda + 09b8c9e commit 1b9bbe5

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ members = [
44
"lightning",
55
"lightning-net-tokio",
66
]
7+
8+
# Our tests do actual crypo and lots of work, the tradeoff for -O1 is well worth it
9+
[profile.dev]
10+
opt-level = 1

fuzz/fuzz_targets/chanmon_fail_consistency.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub struct TestChannelMonitor {
9090
pub should_update_manager: atomic::AtomicBool,
9191
}
9292
impl TestChannelMonitor {
93-
pub fn new(chain_monitor: Arc<chaininterface::ChainWatchInterface>, broadcaster: Arc<chaininterface::BroadcasterInterface>, logger: Arc<Logger>, feeest: Arc<chaininterface::FeeEstimator>) -> Self {
93+
pub fn new(chain_monitor: Arc<dyn chaininterface::ChainWatchInterface>, broadcaster: Arc<dyn chaininterface::BroadcasterInterface>, logger: Arc<dyn Logger>, feeest: Arc<dyn chaininterface::FeeEstimator>) -> Self {
9494
Self {
9595
simple_monitor: channelmonitor::SimpleManyChannelMonitor::new(chain_monitor, broadcaster, logger, feeest),
9696
update_ret: Mutex::new(Ok(())),
@@ -109,7 +109,7 @@ impl channelmonitor::ManyChannelMonitor for TestChannelMonitor {
109109
monitor.write_for_disk(&mut ser).unwrap();
110110
self.latest_good_update.lock().unwrap().insert(funding_txo, ser.0);
111111
match self.latest_update_good.lock().unwrap().entry(funding_txo) {
112-
hash_map::Entry::Vacant(mut e) => { e.insert(true); },
112+
hash_map::Entry::Vacant(e) => { e.insert(true); },
113113
hash_map::Entry::Occupied(mut e) => {
114114
if !e.get() && unsafe { IN_RESTORE } {
115115
// Technically we can't consider an update to be "good" unless we're doing
@@ -184,7 +184,7 @@ pub fn do_test(data: &[u8]) {
184184

185185
macro_rules! make_node {
186186
($node_id: expr) => { {
187-
let logger: Arc<Logger> = Arc::new(test_logger::TestLogger::new($node_id.to_string()));
187+
let logger: Arc<dyn Logger> = Arc::new(test_logger::TestLogger::new($node_id.to_string()));
188188
let watch = Arc::new(ChainWatchInterfaceUtil::new(Network::Bitcoin, Arc::clone(&logger)));
189189
let monitor = Arc::new(TestChannelMonitor::new(watch.clone(), broadcast.clone(), logger.clone(), fee_est.clone()));
190190

@@ -200,7 +200,7 @@ pub fn do_test(data: &[u8]) {
200200

201201
macro_rules! reload_node {
202202
($ser: expr, $node_id: expr, $old_monitors: expr) => { {
203-
let logger: Arc<Logger> = Arc::new(test_logger::TestLogger::new($node_id.to_string()));
203+
let logger: Arc<dyn Logger> = Arc::new(test_logger::TestLogger::new($node_id.to_string()));
204204
let watch = Arc::new(ChainWatchInterfaceUtil::new(Network::Bitcoin, Arc::clone(&logger)));
205205
let monitor = Arc::new(TestChannelMonitor::new(watch.clone(), broadcast.clone(), logger.clone(), fee_est.clone()));
206206

0 commit comments

Comments
 (0)