fixed order of eth_getLogs

This commit is contained in:
debris 2016-02-15 13:39:58 +01:00
parent fada9bb1ba
commit 8b28f627ca

View File

@ -205,11 +205,14 @@ impl Eth for EthClient {
let possibilities = filter.bloom_possibilities(); let possibilities = filter.bloom_possibilities();
let from = filter.from_block.map_or_else(|| BlockId::Earliest, Into::into); let from = filter.from_block.map_or_else(|| BlockId::Earliest, Into::into);
let to = filter.to_block.map_or_else(|| BlockId::Latest, Into::into); let to = filter.to_block.map_or_else(|| BlockId::Latest, Into::into);
let blocks: HashSet<u64> = possibilities.iter() let mut blocks: Vec<u64> = possibilities.iter()
.map(|bloom| self.client.blocks_with_bloom(bloom, from.clone(), to.clone())) .map(|bloom| self.client.blocks_with_bloom(bloom, from.clone(), to.clone()))
.filter_map(|m| m) .filter_map(|m| m)
.flat_map(|m| m) .flat_map(|m| m)
.collect::<HashSet<u64>>()
.into_iter()
.collect(); .collect();
blocks.sort();
to_value(&blocks) to_value(&blocks)
}) })
} }