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
+1 -1
View File
@@ -43,7 +43,7 @@ fn get_output_local(chain: &chain::Chain, commit: &pedersen::Commitment) -> Opti
];
for x in outputs.iter() {
if chain.is_unspent(&x).is_ok() {
if chain.get_unspent(&x).unwrap().is_some() {
let block_height = chain.get_header_for_output(&x).unwrap().height;
let output_pos = chain.get_output_pos(&x.commit).unwrap_or(0);
return Some(api::Output::new(&commit, block_height, output_pos));
+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(());
}
}
}