debugging rpc...
This commit is contained in:
		
							parent
							
								
									fede7ca35c
								
							
						
					
					
						commit
						f38b736c91
					
				| @ -83,6 +83,7 @@ impl EthFilter for EthFilterClient { | ||||
| 	} | ||||
| 
 | ||||
| 	fn filter_changes(&self, _: Params) -> Result<Value, Error> { | ||||
| 		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())])) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -9,6 +9,10 @@ impl NetClient { | ||||
| } | ||||
| 
 | ||||
| impl Net for NetClient { | ||||
| 	fn version(&self, _: Params) -> Result<Value, Error> { | ||||
| 		Ok(Value::U64(63)) | ||||
| 	} | ||||
| 
 | ||||
| 	fn peer_count(&self, _params: Params) -> Result<Value, Error> { | ||||
| 		Ok(Value::U64(0)) | ||||
| 	} | ||||
|  | ||||
| @ -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 | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -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<Self> { | ||||
| 		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 | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -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);
 | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user