Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
update jsonrpc to 12.0 (#10841)
Browse files Browse the repository at this point in the history
* update jsonrpc to 12.0

* use reexported ws error
  • Loading branch information
ordian authored and debris committed Jul 5, 2019
1 parent de906d4 commit 4bb517e
Show file tree
Hide file tree
Showing 31 changed files with 188 additions and 151 deletions.
245 changes: 141 additions & 104 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ serde_derive = "1.0"
futures = "0.1"
fdlimit = "0.1"
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
jsonrpc-core = "10.0.1"
jsonrpc-core = "12.0.0"
parity-bytes = "0.1"
common-types = { path = "ethcore/types" }
ethcore = { path = "ethcore", features = ["parity"] }
Expand Down
4 changes: 2 additions & 2 deletions cli-signer/rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ serde_json = "1.0"
url = "1.2.0"
matches = "0.1"
parking_lot = "0.7"
jsonrpc-core = "10.0.1"
jsonrpc-ws-server = "10.0.1"
jsonrpc-core = "12.0.0"
jsonrpc-ws-server = "12.0.0"
parity-rpc = { path = "../../rpc" }
keccak-hash = "0.2.0"
4 changes: 2 additions & 2 deletions ipfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
ethcore = { path = "../ethcore" }
parity-bytes = "0.1"
ethereum-types = "0.6.0"
jsonrpc-core = "10.0.1"
jsonrpc-http-server = "10.0.1"
jsonrpc-core = "12.0.0"
jsonrpc-http-server = "12.0.0"
rlp = "0.4.0"
cid = "0.3"
multihash = "0.8"
Expand Down
4 changes: 2 additions & 2 deletions miner/stratum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
ethereum-types = "0.6.0"
keccak-hash = "0.2.0"
jsonrpc-core = "10.0.1"
jsonrpc-tcp-server = "10.0.1"
jsonrpc-core = "12.0.0"
jsonrpc-tcp-server = "12.0.0"
log = "0.4"
parking_lot = "0.7"

Expand Down
1 change: 0 additions & 1 deletion parity/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions parity/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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)),
Expand Down
12 changes: 6 additions & 6 deletions rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ tokio-timer = "0.1"
transient-hashmap = "0.4"
itertools = "0.5"

jsonrpc-core = "10.0.1"
jsonrpc-derive = "10.0.2"
jsonrpc-http-server = "10.0.1"
jsonrpc-ws-server = "10.0.1"
jsonrpc-ipc-server = "10.0.1"
jsonrpc-pubsub = "10.0.1"
jsonrpc-core = "12.0.0"
jsonrpc-derive = "12.0.0"
jsonrpc-http-server = "12.0.0"
jsonrpc-ws-server = "12.0.0"
jsonrpc-ipc-server = "12.0.0"
jsonrpc-pubsub = "12.0.0"

common-types = { path = "../ethcore/types" }
ethash = { path = "../ethash" }
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use jsonrpc_derive::rpc;
use v1::types::RichBlock;

/// Debug RPC interface.
#[rpc]
#[rpc(server)]
pub trait Debug {
/// Returns recently seen bad blocks.
#[rpc(name = "debug_getBadBlocks")]
Expand Down
4 changes: 2 additions & 2 deletions rpc/src/v1/traits/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use v1::types::{RichBlock, BlockNumber, Bytes, CallRequest, Filter, FilterChange
use v1::types::{Log, Receipt, SyncStatus, Transaction, Work};

/// Eth rpc interface.
#[rpc]
#[rpc(server)]
pub trait Eth {
/// RPC Metadata
type Metadata;
Expand Down Expand Up @@ -189,7 +189,7 @@ pub trait Eth {

/// Eth filters rpc api (polling).
// TODO: do filters api properly
#[rpc]
#[rpc(server)]
pub trait EthFilter {
/// Returns id of new filter.
#[rpc(name = "eth_newFilter")]
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/eth_pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use jsonrpc_pubsub::{typed, SubscriptionId};
use v1::types::pubsub;

/// Eth PUB-SUB rpc interface.
#[rpc]
#[rpc(server)]
pub trait EthPubSub {
/// RPC Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/eth_signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use ethereum_types::{H160, H256, H520};
use v1::types::{Bytes, TransactionRequest, RichRawTransaction};

/// Signing methods implementation relying on unlocked accounts.
#[rpc]
#[rpc(server)]
pub trait EthSigning {
/// RPC Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use jsonrpc_core::Result;
use jsonrpc_derive::rpc;

/// Net rpc interface.
#[rpc]
#[rpc(server)]
pub trait Net {
/// Returns protocol version.
#[rpc(name = "net_version")]
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use v1::types::{
};

/// Parity-specific rpc interface.
#[rpc]
#[rpc(server)]
pub trait Parity {
/// RPC Metadata
type Metadata;
Expand Down
4 changes: 2 additions & 2 deletions rpc/src/v1/traits/parity_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use v1::types::{DeriveHash, DeriveHierarchical, ExtAccountInfo};
use v1::types::AccountInfo;

/// Parity-specific read-only accounts rpc interface.
#[rpc]
#[rpc(server)]
pub trait ParityAccountsInfo {
/// Returns accounts information.
#[rpc(name = "parity_accountsInfo")]
Expand All @@ -38,7 +38,7 @@ pub trait ParityAccountsInfo {
}

/// Personal Parity rpc interface.
#[rpc]
#[rpc(server)]
pub trait ParityAccounts {
/// Returns accounts information.
#[rpc(name = "parity_allAccountsInfo")]
Expand Down
4 changes: 2 additions & 2 deletions rpc/src/v1/traits/parity_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ use jsonrpc_derive::rpc;
use v1::types::{Bytes, ReleaseInfo, Transaction};

/// Parity-specific rpc interface for operations altering the account-related settings.
#[rpc]
#[rpc(server)]
pub trait ParitySetAccounts {
/// Sets account for signing consensus messages.
#[rpc(name = "parity_setEngineSigner")]
fn set_engine_signer(&self, H160, String) -> Result<bool>;
}

/// Parity-specific rpc interface for operations altering the settings.
#[rpc]
#[rpc(server)]
pub trait ParitySet {
/// Sets new minimal gas price for mined blocks.
#[rpc(name = "parity_setMinGasPrice")]
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/parity_signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use ethereum_types::{H160, U256};
use v1::types::{Bytes, ConfirmationResponse, TransactionRequest, Either};

/// Signing methods implementation.
#[rpc]
#[rpc(server)]
pub trait ParitySigning {
/// RPC Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/personal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use jsonrpc_derive::rpc;
use v1::types::{Bytes, TransactionRequest, RichRawTransaction as RpcRichRawTransaction, EIP191Version};

/// Personal rpc interface. Safe (read-only) functions.
#[rpc]
#[rpc(server)]
pub trait Personal {
/// RPC Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use v1::types::{Bytes, PrivateTransactionReceipt, BlockNumber,
PrivateTransactionReceiptAndTransaction, CallRequest, PrivateTransactionLog};

/// Private transaction management RPC interface.
#[rpc]
#[rpc(server)]
pub trait Private {
/// RPC Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId};
use jsonrpc_derive::rpc;

/// Parity-specific PUB-SUB rpc interface.
#[rpc]
#[rpc(server)]
pub trait PubSub {
/// Pub/Sub Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use jsonrpc_core::Result;
use jsonrpc_derive::rpc;

/// RPC Interface.
#[rpc]
#[rpc(server)]
pub trait Rpc {
/// Returns supported modules for Geth 1.3.6
/// @ignore
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/secretstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use ethkey::Password;
use v1::types::{Bytes, EncryptedDocumentKey};

/// Parity-specific rpc interface.
#[rpc]
#[rpc(server)]
pub trait SecretStore {
/// Generate document key to store in secret store.
/// Arguments: `account`, `password`, `server_key_public`.
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use jsonrpc_derive::rpc;
use v1::types::{Bytes, TransactionModification, ConfirmationRequest, ConfirmationResponse, ConfirmationResponseWithToken};

/// Signer extension for confirmations rpc interface.
#[rpc]
#[rpc(server)]
pub trait Signer {
/// RPC Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use v1::types::{TraceFilter, LocalizedTrace, BlockNumber, Index, CallRequest, By
TraceResultsWithTransactionHash, TraceOptions};

/// Traces specific rpc interface.
#[rpc]
#[rpc(server)]
pub trait Traces {
/// RPC Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/transactions_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use miner::pool::TxStatus;
use ethereum_types::H256;

/// Transactions Pool PUB-SUB rpc interface.
#[rpc]
#[rpc(server)]
pub trait TransactionsPool {
/// Pub/Sub Metadata
type Metadata;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/traits/web3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use jsonrpc_derive::rpc;
use v1::types::Bytes;

/// Web3 rpc interface.
#[rpc]
#[rpc(server)]
pub trait Web3 {
/// Returns current client version.
#[rpc(name = "web3_clientVersion")]
Expand Down
2 changes: 1 addition & 1 deletion secret-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tokio = "~0.1.11"
tokio-io = "0.1"
tokio-service = "0.1"
url = "1.0"
jsonrpc-server-utils = "11.0"
jsonrpc-server-utils = "12.0.0"

[dev-dependencies]
env_logger = "0.5"
Expand Down
6 changes: 3 additions & 3 deletions whisper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ smallvec = "0.6"
tiny-keccak = "1.4"
time-utils = { path = "../util/time-utils" }

jsonrpc-core = "10.0.1"
jsonrpc-derive = "10.0.2"
jsonrpc-pubsub = "10.0.1"
jsonrpc-core = "12.0.0"
jsonrpc-derive = "12.0.0"
jsonrpc-pubsub = "12.0.0"
zeroize = "0.9.1"
6 changes: 3 additions & 3 deletions whisper/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ docopt = "1.0"
env_logger = "0.5"
ethcore-network = { path = "../../util/network" }
ethcore-network-devp2p = { path = "../../util/network-devp2p" }
jsonrpc-core = "10.0.1"
jsonrpc-http-server = "10.0.1"
jsonrpc-pubsub = "10.0.1"
jsonrpc-core = "12.0.0"
jsonrpc-http-server = "12.0.0"
jsonrpc-pubsub = "12.0.0"
log = "0.4"
panic_hook = { path = "../../util/panic-hook" }
parity-whisper = { path = "../" }
Expand Down
1 change: 0 additions & 1 deletion whisper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ extern crate bitflags;
#[macro_use]
extern crate log;

#[macro_use]
extern crate serde_derive;

#[cfg(not(time_checked_add))]
Expand Down
4 changes: 2 additions & 2 deletions whisper/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn abridge_topic(topic: &[u8]) -> EnvelopeTopic {
}

/// Whisper RPC interface.
#[rpc]
#[rpc(server)]
pub trait Whisper {
/// Info about the node.
#[rpc(name = "shh_info")]
Expand Down Expand Up @@ -128,7 +128,7 @@ pub trait Whisper {
}

/// Whisper RPC pubsub.
#[rpc]
#[rpc(server)]
pub trait WhisperPubSub {
// RPC Metadata
type Metadata;
Expand Down

0 comments on commit 4bb517e

Please sign in to comment.