Revalidate transactions only on latest best block (#6824)

* Revalidate transactions only on latest best block

We should revalidate transactions only on the latest best block and not
on any arbitrary block. The revalidation before failed when there were
multiple blocks on the height given to the revalidation function, but no
block was imported as best block.

* Update test-utils/runtime/transaction-pool/src/lib.rs

Co-authored-by: Jaco Greeff <jacogr@gmail.com>

* Fix tests

* Only process best blocks in the transaction pool

Co-authored-by: Jaco Greeff <jacogr@gmail.com>
This commit is contained in:
Bastian Köcher
2020-08-07 13:58:51 +02:00
committed by GitHub
parent 837c18ddfb
commit cde60b871e
9 changed files with 205 additions and 206 deletions
@@ -346,11 +346,9 @@ mod tests {
fn chain_event<B: BlockT>(header: B::Header) -> ChainEvent<B>
where NumberFor<B>: From<u64>
{
ChainEvent::NewBlock {
ChainEvent::NewBestBlock {
hash: header.hash(),
tree_route: None,
is_new_best: true,
header,
}
}