X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=lightning%2Fsrc%2Futil%2Ftest_utils.rs;h=4bcaca57f81ca61cd2af4d499d6ffbfa4f1b51e0;hb=327142894dc51200255af73721fd58a8187c6021;hp=7a9ce06910b975d8ead47607a5272e1dcf92d0c5;hpb=073f0780f6b2d72de57e5bb5a7b690c0206fa40c;p=rust-lightning
diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs
index 7a9ce0691..4bcaca57f 100644
--- a/lightning/src/util/test_utils.rs
+++ b/lightning/src/util/test_utils.rs
@@ -13,7 +13,7 @@ use crate::chain::chaininterface;
use crate::chain::chaininterface::ConfirmationTarget;
use crate::chain::chaininterface::FEERATE_FLOOR_SATS_PER_KW;
use crate::chain::chainmonitor;
-use crate::chain::chainmonitor::MonitorUpdateId;
+use crate::chain::chainmonitor::{MonitorUpdateId, UpdateOrigin};
use crate::chain::channelmonitor;
use crate::chain::channelmonitor::MonitorEvent;
use crate::chain::transaction::OutPoint;
@@ -38,6 +38,7 @@ use crate::util::config::UserConfig;
use crate::util::test_channel_signer::{TestChannelSigner, EnforcementState};
use crate::util::logger::{Logger, Level, Record};
use crate::util::ser::{Readable, ReadableArgs, Writer, Writeable};
+use crate::util::persist::KVStore;
use bitcoin::EcdsaSighashType;
use bitcoin::blockdata::constants::ChainHash;
@@ -61,7 +62,6 @@ use regex;
use crate::io;
use crate::prelude::*;
use core::cell::RefCell;
-use core::ops::Deref;
use core::time::Duration;
use crate::sync::{Mutex, Arc};
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
@@ -124,6 +124,7 @@ impl<'a> Router for TestRouter<'a> {
if let Some((find_route_query, find_route_res)) = self.next_routes.lock().unwrap().pop_front() {
assert_eq!(find_route_query, *params);
if let Ok(ref route) = find_route_res {
+ assert_eq!(route.route_params.as_ref().unwrap().final_value_msat, find_route_query.final_value_msat);
let scorer = self.scorer.read().unwrap();
let scorer = ScorerAccountingForInFlightHtlcs::new(scorer, &inflight_htlcs);
for path in &route.paths {
@@ -206,6 +207,9 @@ pub struct TestChainMonitor<'a> {
/// ChannelForceClosed event for the given channel_id with should_broadcast set to the given
/// boolean.
pub expect_channel_force_closed: Mutex