From e4e06f66ec4022c219f0db99b42beea0da442ac0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 2 Aug 2022 11:07:18 +0100 Subject: [PATCH] chanmgr testing: FakeChannel: retain the ChannelsParamsUpdates --- crates/tor-chanmgr/src/mgr.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/tor-chanmgr/src/mgr.rs b/crates/tor-chanmgr/src/mgr.rs index 49c491ba6..faa756b03 100644 --- a/crates/tor-chanmgr/src/mgr.rs +++ b/crates/tor-chanmgr/src/mgr.rs @@ -346,6 +346,7 @@ mod test { mood: char, closing: Arc, detect_reuse: Arc, + last_params: Option, } impl PartialEq for FakeChannel { @@ -365,7 +366,8 @@ mod test { fn duration_unused(&self) -> Option { None } - fn reparameterize(&mut self, _updates: Arc) -> tor_proto::Result<()> { + fn reparameterize(&mut self, updates: Arc) -> tor_proto::Result<()> { + self.last_params = Some((*updates).clone()); Ok(()) } fn note_usage(&self, _usage: ChannelUsage) -> StdResult<(), tor_error::Bug> { @@ -412,6 +414,7 @@ mod test { mood, closing: Arc::new(AtomicBool::new(false)), detect_reuse: Default::default(), + last_params: None, }) } }