Skip to content
Snippets Groups Projects
Commit 49cc4070 authored by Tomasz Drwięga's avatar Tomasz Drwięga Committed by Gav Wood
Browse files

Fixing formatter for defaultExtraData (#1060)

parent a4dcbceb
Branches
Tags
No related merge requests found
...@@ -133,6 +133,6 @@ impl<M> Ethcore for EthcoreClient<M> where M: MinerService + 'static { ...@@ -133,6 +133,6 @@ impl<M> Ethcore for EthcoreClient<M> where M: MinerService + 'static {
fn default_extra_data(&self, _params: Params) -> Result<Value, Error> { fn default_extra_data(&self, _params: Params) -> Result<Value, Error> {
let version = version_data(); let version = version_data();
to_value(&version) to_value(&Bytes::new(version))
} }
} }
...@@ -62,6 +62,21 @@ fn rpc_ethcore_extra_data() { ...@@ -62,6 +62,21 @@ fn rpc_ethcore_extra_data() {
assert_eq!(io.handle_request(request), Some(response.to_owned())); 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] #[test]
fn rpc_ethcore_gas_floor_target() { fn rpc_ethcore_gas_floor_target() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment