diff --git a/src/bin/client/rpc/impls/eth.rs b/src/bin/client/rpc/impls/eth.rs index d960114ed..821eacd07 100644 --- a/src/bin/client/rpc/impls/eth.rs +++ b/src/bin/client/rpc/impls/eth.rs @@ -83,6 +83,7 @@ impl EthFilter for EthFilterClient { } fn filter_changes(&self, _: Params) -> Result { - Ok(Value::String(self.client.chain_info().best_block_hash.to_hex())) + println!("filter changes: {:?}", self.client.chain_info().best_block_hash.to_hex()); + Ok(Value::Array(vec![Value::String(self.client.chain_info().best_block_hash.to_hex())])) } } diff --git a/src/bin/client/rpc/impls/net.rs b/src/bin/client/rpc/impls/net.rs index 6e528d156..f0109429c 100644 --- a/src/bin/client/rpc/impls/net.rs +++ b/src/bin/client/rpc/impls/net.rs @@ -9,6 +9,10 @@ impl NetClient { } impl Net for NetClient { + fn version(&self, _: Params) -> Result { + Ok(Value::U64(63)) + } + fn peer_count(&self, _params: Params) -> Result { Ok(Value::U64(0)) } diff --git a/src/bin/client/rpc/traits/eth.rs b/src/bin/client/rpc/traits/eth.rs index dfc72e89a..856111444 100644 --- a/src/bin/client/rpc/traits/eth.rs +++ b/src/bin/client/rpc/traits/eth.rs @@ -59,7 +59,7 @@ pub trait EthFilter: Sized + Send + Sync + 'static { let mut delegate = IoDelegate::new(Arc::new(self)); delegate.add_method("eth_newBlockFilter", EthFilter::new_block_filter); delegate.add_method("eth_newPendingTransactionFilter", EthFilter::new_pending_transaction_filter); - delegate.add_method("eth_getFilterChanges", EthFilter::new_block_filter); + delegate.add_method("eth_getFilterChanges", EthFilter::filter_changes); delegate } } diff --git a/src/bin/client/rpc/traits/net.rs b/src/bin/client/rpc/traits/net.rs index 7cb7f6bee..63c64edb3 100644 --- a/src/bin/client/rpc/traits/net.rs +++ b/src/bin/client/rpc/traits/net.rs @@ -13,8 +13,8 @@ pub trait Net: Sized + Send + Sync + 'static { /// Should be used to convert object to io delegate. fn to_delegate(self) -> IoDelegate { let mut delegate = IoDelegate::new(Arc::new(self)); - delegate.add_method("peer_count", Net::version); delegate.add_method("net_version", Net::version); + delegate.add_method("net_peerCount", Net::peer_count); delegate } } diff --git a/src/client.rs b/src/client.rs index 4461f3d7b..01da143e5 100644 --- a/src/client.rs +++ b/src/client.rs @@ -269,7 +269,7 @@ impl Client { /// Tick the client. pub fn tick(&self) { - self.chain.read().unwrap().collect_garbage(false); + //self.chain.read().unwrap().collect_garbage(false); } }