Wallet operation to burn some coins (#172)

* Burn transaction for testing
* Burn bug fixes, embed burn key in keychain
* Better error logging in API, wallet fee calc fix
This commit is contained in:
Ignotus Peverell
2017-10-12 03:35:40 +00:00
committed by GitHub
parent bf7c1fb44f
commit b85006ebe5
9 changed files with 158 additions and 49 deletions
+13 -5
View File
@@ -210,11 +210,19 @@ where
let t: E::OP_IN = serde_json::from_reader(req.body.by_ref()).map_err(|e| {
IronError::new(e, status::BadRequest)
})?;
let res = self.endpoint.operation(self.operation.clone(), t)?;
let res_json = serde_json::to_string(&res).map_err(|e| {
IronError::new(e, status::InternalServerError)
})?;
Ok(Response::with((status::Ok, res_json)))
let res = self.endpoint.operation(self.operation.clone(), t);
match res {
Ok(resp) => {
let res_json = serde_json::to_string(&resp).map_err(|e| {
IronError::new(e, status::InternalServerError)
})?;
Ok(Response::with((status::Ok, res_json)))
}
Err(e) => {
error!("API operation: {:?}", e);
Err(IronError::from(e))
}
}
}
}