Transaction queue tests update (#4734)

* shuffle tests

* update tests

* inc_nonce -> increment_nonce
This commit is contained in:
Nikolay Volf
2020-01-27 04:22:04 -08:00
committed by GitHub
parent 9cea98e950
commit 94a187f291
5 changed files with 196 additions and 101 deletions
@@ -231,7 +231,7 @@ mod tests {
use sc_transaction_pool::{
BasicPool,
txpool::Options,
testing::*,
testing::api::*,
};
use sp_transaction_pool::TransactionPool;
use sp_runtime::generic::BlockId;
@@ -242,10 +242,7 @@ mod tests {
use sc_basic_authorship::ProposerFactory;
fn api() -> TestApi {
let mut api = TestApi::default();
api.nonce_offset = 0;
api
TestApi::empty()
}
#[tokio::test]
@@ -422,6 +419,7 @@ mod tests {
finalize: false,
}).await.unwrap();
let created_block = rx.await.unwrap().unwrap();
pool.api().increment_nonce(Alice.into());
// assert that the background task returns ok
assert_eq!(
@@ -451,6 +449,7 @@ mod tests {
}).await.is_ok());
assert!(rx1.await.unwrap().is_ok());
assert!(backend.blockchain().header(BlockId::Number(1)).unwrap().is_some());
pool.api().increment_nonce(Alice.into());
assert!(pool.submit_one(&BlockId::Number(2), uxt(Alice, 2)).await.is_ok());
let (tx2, rx2) = futures::channel::oneshot::channel();