]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix benchmark compile warnings and errors
authorMatt Corallo <git@bluematt.me>
Mon, 12 Apr 2021 22:04:55 +0000 (18:04 -0400)
committerMatt Corallo <git@bluematt.me>
Mon, 12 Apr 2021 22:04:55 +0000 (18:04 -0400)
Hopefully soon once a few more PRs get merged we can require this
in CI so we won't have any more regressions here.

lightning/src/ln/channelmanager.rs
lightning/src/routing/router.rs

index e87b221025f189ade4bff5ebde5af8908dfa62d9..ae8db0356964785e0d1f3947cfb1c10a823d8daf 100644 (file)
@@ -4480,7 +4480,6 @@ pub mod bench {
        use chain::chainmonitor::ChainMonitor;
        use chain::channelmonitor::Persist;
        use chain::keysinterface::{KeysManager, InMemorySigner};
-       use chain::transaction::OutPoint;
        use ln::channelmanager::{ChainParameters, ChannelManager, PaymentHash, PaymentPreimage};
        use ln::features::InitFeatures;
        use ln::functional_test_utils::*;
@@ -4558,14 +4557,13 @@ pub mod bench {
                        tx = Transaction { version: 2, lock_time: 0, input: Vec::new(), output: vec![TxOut {
                                value: 8_000_000, script_pubkey: output_script,
                        }]};
-                       let funding_outpoint = OutPoint { txid: tx.txid(), index: 0 };
-                       node_a.funding_transaction_generated(&temporary_channel_id, funding_outpoint);
+                       node_a.funding_transaction_generated(&temporary_channel_id, tx.clone()).unwrap();
                } else { panic!(); }
 
                node_b.handle_funding_created(&node_a.get_our_node_id(), &get_event_msg!(node_a_holder, MessageSendEvent::SendFundingCreated, node_b.get_our_node_id()));
                node_a.handle_funding_signed(&node_b.get_our_node_id(), &get_event_msg!(node_b_holder, MessageSendEvent::SendFundingSigned, node_a.get_our_node_id()));
 
-               get_event!(node_a_holder, Event::FundingBroadcastSafe);
+               assert_eq!(&tx_broadcaster.txn_broadcasted.lock().unwrap()[..], &[tx.clone()]);
 
                let block = Block {
                        header: BlockHeader { version: 0x20000000, prev_blockhash: genesis_hash, merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 },
index a74f0cf53d9a650a43517c2c155744f1b8935934..5e36a281fce18b4379634b35aed7572289cda16a 100644 (file)
@@ -3922,7 +3922,6 @@ mod benches {
        use super::*;
        use util::logger::{Logger, Record};
 
-       use std::fs::File;
        use test::Bencher;
 
        struct DummyLogger {}