Merge branch 'master' into types-binary
This commit is contained in:
commit
6d8749fbdd
23
Cargo.lock
generated
23
Cargo.lock
generated
@ -357,11 +357,12 @@ dependencies = [
|
||||
"clippy 0.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-rpc 1.2.0",
|
||||
"ethcore-util 1.2.0",
|
||||
"hyper 0.9.2 (git+https://github.com/hyperium/hyper?branch=mio)",
|
||||
"hyper 0.9.3 (git+https://github.com/hyperium/hyper?branch=mio)",
|
||||
"jsonrpc-core 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-http-server 5.1.0 (git+https://github.com/ethcore/jsonrpc-http-server.git)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-status 0.3.6 (git+https://github.com/ethcore/parity-status.git)",
|
||||
"parity-status 0.3.7 (git+https://github.com/ethcore/parity-status.git)",
|
||||
"parity-wallet 0.1.1 (git+https://github.com/ethcore/parity-wallet.git)",
|
||||
"parity-webapp 0.1.0 (git+https://github.com/ethcore/parity-webapp.git)",
|
||||
"url 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -492,8 +493,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "0.9.2"
|
||||
source = "git+https://github.com/hyperium/hyper?branch=mio#11930b61857e15830d558303ba5e77f6c02d06fd"
|
||||
version = "0.9.3"
|
||||
source = "git+https://github.com/hyperium/hyper?branch=mio#dbb4cf160ebf242f7f0459d547c40e9e6877ccf4"
|
||||
dependencies = [
|
||||
"cookie 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -574,7 +575,7 @@ name = "jsonrpc-http-server"
|
||||
version = "5.1.0"
|
||||
source = "git+https://github.com/ethcore/jsonrpc-http-server.git#b32815330c191aff06a6e017ba00c10e872bb4f6"
|
||||
dependencies = [
|
||||
"hyper 0.9.2 (git+https://github.com/hyperium/hyper?branch=mio)",
|
||||
"hyper 0.9.3 (git+https://github.com/hyperium/hyper?branch=mio)",
|
||||
"jsonrpc-core 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -824,8 +825,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "parity-status"
|
||||
version = "0.3.6"
|
||||
source = "git+https://github.com/ethcore/parity-status.git#738f8d9da554f82492721f99ba064e7fec693300"
|
||||
version = "0.3.7"
|
||||
source = "git+https://github.com/ethcore/parity-status.git#b0ae32a7fe2f843e4e22dc38903fd2c3e7fb0763"
|
||||
dependencies = [
|
||||
"parity-webapp 0.1.0 (git+https://github.com/ethcore/parity-webapp.git)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parity-wallet"
|
||||
version = "0.1.1"
|
||||
source = "git+https://github.com/ethcore/parity-wallet.git#125b2c05118890eac7b845f832f39b069d9b4be8"
|
||||
dependencies = [
|
||||
"parity-webapp 0.1.0 (git+https://github.com/ethcore/parity-webapp.git)",
|
||||
]
|
||||
|
@ -136,6 +136,9 @@ Footprint Options:
|
||||
options.
|
||||
|
||||
Legacy Options:
|
||||
--geth Run in Geth-compatibility mode. Currently just sets
|
||||
the IPC path to be the same as Geth's. Overrides
|
||||
the --ipc-path/--ipcpath options.
|
||||
--datadir PATH Equivalent to --db-path PATH.
|
||||
--testnet Equivalent to --chain testnet.
|
||||
--networkid INDEX Equivalent to --network-id INDEX.
|
||||
@ -214,6 +217,7 @@ pub struct Args {
|
||||
pub flag_logging: Option<String>,
|
||||
pub flag_version: bool,
|
||||
// legacy...
|
||||
pub flag_geth: bool,
|
||||
pub flag_nodekey: Option<String>,
|
||||
pub flag_nodiscover: bool,
|
||||
pub flag_maxpeers: Option<usize>,
|
||||
|
@ -267,10 +267,18 @@ impl Configuration {
|
||||
self.args.flag_jsonrpc_cors.clone().or(self.args.flag_rpccorsdomain.clone())
|
||||
}
|
||||
|
||||
fn geth_ipc_path() -> &'static str {
|
||||
if cfg!(target_os = "macos") {
|
||||
"$HOME/Library/Ethereum/geth.ipc"
|
||||
} else {
|
||||
"$HOME/.ethereum/geth.ipc"
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ipc_settings(&self) -> IpcConfiguration {
|
||||
IpcConfiguration {
|
||||
enabled: !(self.args.flag_ipcdisable || self.args.flag_ipc_off),
|
||||
socket_addr: self.args.flag_ipcpath.clone().unwrap_or(self.args.flag_ipc_path.clone())
|
||||
socket_addr: if self.args.flag_geth { Self::geth_ipc_path().to_owned() } else { self.args.flag_ipcpath.clone().unwrap_or(self.args.flag_ipc_path.clone()) }
|
||||
.replace("$HOME", env::home_dir().unwrap().to_str().unwrap()),
|
||||
apis: self.args.flag_ipcapi.clone().unwrap_or(self.args.flag_ipc_apis.clone()),
|
||||
}
|
||||
|
@ -133,6 +133,6 @@ impl<M> Ethcore for EthcoreClient<M> where M: MinerService + 'static {
|
||||
|
||||
fn default_extra_data(&self, _params: Params) -> Result<Value, Error> {
|
||||
let version = version_data();
|
||||
to_value(&version)
|
||||
to_value(&Bytes::new(version))
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,21 @@ fn rpc_ethcore_extra_data() {
|
||||
assert_eq!(io.handle_request(request), Some(response.to_owned()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rpc_ethcore_default_extra_data() {
|
||||
use util::misc;
|
||||
use util::ToPretty;
|
||||
|
||||
let miner = miner_service();
|
||||
let ethcore = ethcore_client(&miner).to_delegate();
|
||||
let io = IoHandler::new();
|
||||
io.add_delegate(ethcore);
|
||||
|
||||
let request = r#"{"jsonrpc": "2.0", "method": "ethcore_defaultExtraData", "params": [], "id": 1}"#;
|
||||
let response = format!(r#"{{"jsonrpc":"2.0","result":"0x{}","id":1}}"#, misc::version_data().to_hex());
|
||||
|
||||
assert_eq!(io.handle_request(request), Some(response));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rpc_ethcore_gas_floor_target() {
|
||||
|
@ -17,10 +17,10 @@ ethcore-rpc = { path = "../rpc" }
|
||||
ethcore-util = { path = "../util" }
|
||||
parity-webapp = { git = "https://github.com/ethcore/parity-webapp.git" }
|
||||
# List of apps
|
||||
parity-status = { git = "https://github.com/ethcore/parity-status.git", version = "0.3.6" }
|
||||
parity-wallet = { git = "https://github.com/ethcore/parity-wallet.git", optional = true }
|
||||
parity-status = { git = "https://github.com/ethcore/parity-status.git", version = "0.3.7" }
|
||||
parity-wallet = { git = "https://github.com/ethcore/parity-wallet.git", version = "0.1.1", optional = true }
|
||||
clippy = { version = "0.0.64", optional = true}
|
||||
|
||||
[features]
|
||||
default = []
|
||||
default = ["parity-wallet"]
|
||||
dev = ["clippy", "ethcore-rpc/dev", "ethcore-util/dev"]
|
||||
|
Loading…
Reference in New Issue
Block a user