diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index 212dead9a..6f96c71b1 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -348,11 +348,11 @@ impl BlockChainClient for TestBlockChainClient { } fn transaction(&self, _id: TransactionID) -> Option { - unimplemented!(); + None } fn uncle(&self, _id: UncleID) -> Option { - unimplemented!(); + None } fn transaction_receipt(&self, id: TransactionID) -> Option { diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index fa5ee459e..5aced9d0c 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -433,11 +433,14 @@ impl Eth for EthClient where try!(self.active()); from_params::<(RpcH256,)>(params) .and_then(|(hash,)| { - let miner = take_weak!(self.miner); let hash: H256 = hash.into(); - match miner.transaction(&hash) { - Some(pending_tx) => to_value(&Transaction::from(pending_tx)), - None => self.transaction(TransactionID::Hash(hash)) + let miner = take_weak!(self.miner); + let client = take_weak!(self.client); + let maybe_tx = client.transaction(TransactionID::Hash(hash)).map(Transaction::from) + .or_else(|| miner.transaction(&hash).map(Transaction::from)); + match maybe_tx { + Some(t) => to_value(&t), + None => Ok(Value::Null), } }) }