mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 08:07:58 +00:00
Fix revalidation not revalidating multiple times (#5065)
This commit is contained in:
@@ -267,6 +267,34 @@ fn should_not_retain_invalid_hashes_from_retracted() {
|
||||
assert_eq!(pool.status().ready, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_revalidate_transaction_multiple_times() {
|
||||
let xt = uxt(Alice, 209);
|
||||
|
||||
let (pool, _guard) = maintained_pool();
|
||||
|
||||
block_on(pool.submit_one(&BlockId::number(0), xt.clone())).expect("1. Imported");
|
||||
assert_eq!(pool.status().ready, 1);
|
||||
|
||||
pool.api.push_block(1, vec![xt.clone()]);
|
||||
|
||||
// maintenance is in background
|
||||
block_on(pool.maintain(block_event(1)));
|
||||
block_on(futures_timer::Delay::new(BACKGROUND_REVALIDATION_INTERVAL*2));
|
||||
|
||||
block_on(pool.submit_one(&BlockId::number(0), xt.clone())).expect("1. Imported");
|
||||
assert_eq!(pool.status().ready, 1);
|
||||
|
||||
pool.api.push_block(2, vec![]);
|
||||
pool.api.add_invalid(&xt);
|
||||
|
||||
// maintenance is in background
|
||||
block_on(pool.maintain(block_event(2)));
|
||||
block_on(futures_timer::Delay::new(BACKGROUND_REVALIDATION_INTERVAL*2));
|
||||
|
||||
assert_eq!(pool.status().ready, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_push_watchers_during_maintaince() {
|
||||
fn alice_uxt(nonce: u64) -> Extrinsic {
|
||||
|
||||
Reference in New Issue
Block a user