From e7791c220a3ea76e3d8dd6fb017b8bd9ee856dad Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Thu, 26 May 2016 13:26:07 +0200 Subject: [PATCH] rebase fixes and address style concern --- rpc/src/v1/tests/helpers/miner_service.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rpc/src/v1/tests/helpers/miner_service.rs b/rpc/src/v1/tests/helpers/miner_service.rs index 36296613c..600f88508 100644 --- a/rpc/src/v1/tests/helpers/miner_service.rs +++ b/rpc/src/v1/tests/helpers/miner_service.rs @@ -121,11 +121,9 @@ impl MinerService for TestMinerService { // lets assume that all txs are valid self.imported_transactions.lock().unwrap().extend_from_slice(&transactions); - for transaction in &transactions { - if let Ok(ref sender) = transaction.sender() { - let nonce = self.last_nonce(sender).unwrap_or(fetch_account(sender).nonce); - self.last_nonces.write().unwrap().insert(sender.clone(), nonce + U256::from(1)); - } + for sender in transactions.iter().filter_map(|t| t.sender().ok()) { + let nonce = self.last_nonce(&sender).unwrap_or(fetch_account(&sender).nonce); + self.last_nonces.write().unwrap().insert(sender, nonce + U256::from(1)); } transactions .iter()