update jsonrpc to 12.0 (#10841)

* update jsonrpc to 12.0

* use reexported ws error
This commit is contained in:
Andronik Ordian
2019-07-05 10:24:24 +02:00
committed by Marek Kotewicz
parent de906d4afd
commit 4bb517ec94
31 changed files with 188 additions and 151 deletions

View File

@@ -34,7 +34,6 @@ use ethcore::miner::{stratum, MinerOptions};
use ethcore::snapshot::SnapshotConfiguration;
use ethcore::verification::queue::VerifierSettings;
use miner::pool;
use num_cpus;
use rpc::{IpcConfiguration, HttpConfiguration, WsConfiguration};
use parity_rpc::NetworkSettings;

View File

@@ -29,7 +29,7 @@ use parity_rpc::{self as rpc, Metadata, DomainsValidation};
use rpc_apis::{self, ApiSet};
pub use parity_rpc::{IpcServer, HttpServer, RequestMiddleware};
pub use parity_rpc::ws::Server as WsServer;
pub use parity_rpc::ws::{Server as WsServer, ws};
pub const DAPPS_DOMAIN: &'static str = "web3.site";
@@ -187,7 +187,9 @@ pub fn new_ws<D: rpc_apis::Dependencies>(
match start_result {
Ok(server) => Ok(Some(server)),
Err(rpc::ws::Error(rpc::ws::ErrorKind::Io(ref err), _)) if err.kind() == io::ErrorKind::AddrInUse => Err(
Err(rpc::ws::Error::WsError(ws::Error {
kind: ws::ErrorKind::Io(ref err), ..
})) if err.kind() == io::ErrorKind::AddrInUse => Err(
format!("WebSockets address {} is already in use, make sure that another instance of an Ethereum client is not running or change the address using the --ws-port and --ws-interface options.", url)
),
Err(e) => Err(format!("WebSockets error: {:?}", e)),