[ethcore]: apply filter when PendingSet::AlwaysQueue in ready_transactions_filtered (#11227)

* [ethcore]: apply filter when `from_queue`

In `ready_transactions_filtered` the filter were never applied when
the options PendingSet::AlwaysQueue` was configured which this fixes

It also adds a two tests for it

* [ethcore test-helpers]: stray printlns

* docs(ethcore filter options): more generic desc

* tests(ethcore miner): simply filter tests

* [ethcore filter_options]: fix nits

* doc: nit

Co-Authored-By: David <dvdplm@gmail.com>

* doc: nit

Co-Authored-By: David <dvdplm@gmail.com>

* doc: nit

Co-Authored-By: David <dvdplm@gmail.com>

* doc: nit

Co-Authored-By: David <dvdplm@gmail.com>

* doc: nit

Co-Authored-By: David <dvdplm@gmail.com>

* doc(miner filter): simplify documentation

* [rpc]: make tests compile
This commit is contained in:
Niklas Adolfsson
2019-11-25 12:03:50 +01:00
committed by Andronik Ordian
parent 1b0948d9d1
commit dcb69ba353
3 changed files with 922 additions and 820 deletions

View File

@@ -229,8 +229,23 @@ impl MinerService for TestMinerService {
self.queued_transactions()
}
fn ready_transactions_filtered<C>(&self, _chain: &C, _max_len: usize, _filter: Option<FilterOptions>, _ordering: miner::PendingOrdering) -> Vec<Arc<VerifiedTransaction>> {
fn ready_transactions_filtered<C>(
&self,
_chain: &C,
max_len: usize,
filter: Option<FilterOptions>,
_ordering: miner::PendingOrdering
) -> Vec<Arc<VerifiedTransaction>> {
self.queued_transactions()
.iter()
.cloned()
.filter(|tx| {
filter.as_ref().map_or(true, |filter| {
filter.matches(tx.signed())
})
})
.take(max_len)
.collect()
}
fn pending_transaction_hashes<C>(&self, _chain: &C) -> BTreeSet<H256> {