mirror of
https://github.com/mimblewimble/grin-wallet.git
synced 2025-01-20 19:11:09 +03:00
updates to ensure compilation against grin 5.0.2 (#644)
This commit is contained in:
parent
cecb084753
commit
fa39fca201
3 changed files with 405 additions and 359 deletions
735
Cargo.lock
generated
735
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -24,6 +24,7 @@ use crate::libwallet::{
|
|||
use crate::util::secp::key::SecretKey;
|
||||
use crate::util::{from_hex, static_secp_instance, to_base64, Mutex};
|
||||
use failure::ResultExt;
|
||||
use futures::channel::oneshot;
|
||||
use grin_wallet_api::JsonId;
|
||||
use grin_wallet_config::types::{TorBridgeConfig, TorProxyConfig};
|
||||
use grin_wallet_util::OnionV3Address;
|
||||
|
@ -261,11 +262,14 @@ where
|
|||
.map_err(|_| ErrorKind::GenericError("Router failed to add route".to_string()))?;
|
||||
}
|
||||
|
||||
let api_chan: &'static mut (oneshot::Sender<()>, oneshot::Receiver<()>) =
|
||||
Box::leak(Box::new(oneshot::channel::<()>()));
|
||||
|
||||
let mut apis = ApiServer::new();
|
||||
warn!("Starting HTTP Owner API server at {}.", addr);
|
||||
let socket_addr: SocketAddr = addr.parse().expect("unable to parse socket address");
|
||||
let api_thread =
|
||||
apis.start(socket_addr, router, tls_config)
|
||||
let api_thread = apis
|
||||
.start(socket_addr, router, tls_config, api_chan)
|
||||
.context(ErrorKind::GenericError(
|
||||
"API thread failed to start".to_string(),
|
||||
))?;
|
||||
|
@ -333,11 +337,14 @@ where
|
|||
.add_route("/v2/foreign", Arc::new(api_handler_v2))
|
||||
.map_err(|_| ErrorKind::GenericError("Router failed to add route".to_string()))?;
|
||||
|
||||
let api_chan: &'static mut (oneshot::Sender<()>, oneshot::Receiver<()>) =
|
||||
Box::leak(Box::new(oneshot::channel::<()>()));
|
||||
|
||||
let mut apis = ApiServer::new();
|
||||
warn!("Starting HTTP Foreign listener API server at {}.", addr);
|
||||
let socket_addr: SocketAddr = addr.parse().expect("unable to parse socket address");
|
||||
let api_thread =
|
||||
apis.start(socket_addr, router, tls_config)
|
||||
let api_thread = apis
|
||||
.start(socket_addr, router, tls_config, api_chan)
|
||||
.context(ErrorKind::GenericError(
|
||||
"API thread failed to start".to_string(),
|
||||
))?;
|
||||
|
|
|
@ -333,7 +333,7 @@ where
|
|||
{
|
||||
// TODO: change create_post_request to accept a url instead of a &str
|
||||
let req = api::client::create_post_request(url.as_str(), api_secret, input)?;
|
||||
let res = api::client::send_request(req)?;
|
||||
let res = api::client::send_request(req, api::client::TimeOut::default())?;
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue