From cf18c4bb0ac89f507deec985d1de69b3b9a8ad7f Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Wed, 25 May 2016 12:30:55 +0200 Subject: [PATCH] make MinerService object-safe --- miner/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/miner/src/lib.rs b/miner/src/lib.rs index e9ac7aba2..a1780efff 100644 --- a/miner/src/lib.rs +++ b/miner/src/lib.rs @@ -107,12 +107,12 @@ pub trait MinerService : Send + Sync { /// Imports transactions to transaction queue. fn import_transactions(&self, transactions: Vec, fetch_account: T) -> Vec> - where T: Fn(&Address) -> AccountDetails; + where T: Fn(&Address) -> AccountDetails, Self: Sized; /// Imports own (node owner) transaction to queue. fn import_own_transaction(&self, chain: &BlockChainClient, transaction: SignedTransaction, fetch_account: T) -> Result - where T: Fn(&Address) -> AccountDetails; + where T: Fn(&Address) -> AccountDetails, Self: Sized; /// Returns hashes of transactions currently in pending fn pending_transactions_hashes(&self) -> Vec; @@ -131,7 +131,8 @@ pub trait MinerService : Send + Sync { fn submit_seal(&self, chain: &BlockChainClient, pow_hash: H256, seal: Vec) -> Result<(), Error>; /// Get the sealing work package and if `Some`, apply some transform. - fn map_sealing_work(&self, chain: &BlockChainClient, f: F) -> Option where F: FnOnce(&ClosedBlock) -> T; + fn map_sealing_work(&self, chain: &BlockChainClient, f: F) -> Option + where F: FnOnce(&ClosedBlock) -> T, Self: Sized; /// Query pending transactions for hash. fn transaction(&self, hash: &H256) -> Option;