1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00
This commit is contained in:
Rob Ede
2022-07-09 21:05:06 +01:00
parent e97bc83f59
commit 4b801ba222
10 changed files with 55 additions and 42 deletions

View File

@ -62,13 +62,14 @@ async fn rpc_select(
if params.len() != 1 || !params[0].is_u64() {
return Err(convention::ErrorData::std(-32602));
}
match app_state
let fut = app_state
.network
.read()
.unwrap()
.wait(params[0].as_u64().unwrap())
.await
{
.wait(params[0].as_u64().unwrap());
match fut.await {
Ok(ok) => Ok(Value::from(ok)),
Err(e) => Err(convention::ErrorData::new(500, &format!("{e:?}")[..])),
}