Stop proxy in controller tests to allow dir cleanup on Windows (#363)

* Stop wallet proxy in controller tests to allow directory cleanup in Windows

* Update test client

* Update to latest grin master

* is_unspent -> get_unspent
This commit is contained in:
jaspervdm
2020-03-10 12:00:33 +01:00
committed by GitHub
parent 1810854b24
commit 63eb25a92b
15 changed files with 63 additions and 15 deletions
+9 -4
View File
@@ -139,8 +139,16 @@ where
self.running.store(true, Ordering::Relaxed);
loop {
thread::sleep(Duration::from_millis(10));
if !self.running.load(Ordering::Relaxed) {
info!("Proxy stopped");
return Ok(());
}
// read queue
let m = self.rx.recv().unwrap();
let m = match self.rx.recv_timeout(Duration::from_millis(10)) {
Ok(m) => m,
Err(_) => continue,
};
trace!("Wallet Client Proxy Received: {:?}", m);
let resp = match m.method.as_ref() {
"get_chain_tip" => self.get_chain_tip(m)?,
@@ -154,9 +162,6 @@ where
};
self.respond(resp);
if !self.running.load(Ordering::Relaxed) {
return Ok(());
}
}
}