Fix transaction pool & network issues (#6288)

* fix & tweaks

* address review

* line width
This commit is contained in:
Nikolay Volf authored and GitHub committed 2020-06-08 23:58:08 +02:00
1 parent 881072e590
commit 65ba701f50
3 files changed
+52 -9

No files matched your search

@@ -281,6 +281,25 @@ fn should_resubmit_from_retracted_during_maintenance() {
assert_eq!(pool.status().ready, 1);
}
#[test]
fn should_not_resubmit_from_retracted_during_maintenance_if_tx_is_also_in_enacted() {
let xt = uxt(Alice, 209);
let (pool, _guard, _notifier) = maintained_pool();
block_on(pool.submit_one(&BlockId::number(0), SOURCE, xt.clone())).expect("1. Imported");
assert_eq!(pool.status().ready, 1);
let header = pool.api.push_block(1, vec![xt.clone()]);
let fork_header = pool.api.push_block(1, vec![xt]);
let event = block_event_with_retracted(header, fork_header.hash(), &*pool.api);
block_on(pool.maintain(event));
assert_eq!(pool.status().ready, 0);
}
#[test]
fn should_not_retain_invalid_hashes_from_retracted() {
let xt = uxt(Alice, 209);