mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
2ae9d36758
* Use TransactionPool trait * sc-transaction-pool-primitives * sc-transaction-pool-api * TP * bye sc_transaction_graph * fix line widths * fix import errors * fix import errors * fix import errors 🤦🏾♂️ * fix import errors 🤦🏾♂️🤦🏾♂️🤦🏾♂️ * remove sp-keyring
32 lines
1.1 KiB
Rust
32 lines
1.1 KiB
Rust
use sc_transaction_pool::test_helpers::{Pool, RevalidationQueue};
|
|
use sc_transaction_pool_api::TransactionSource;
|
|
use substrate_test_runtime_transaction_pool::{TestApi, uxt};
|
|
use futures::executor::block_on;
|
|
use substrate_test_runtime_client::AccountKeyring::*;
|
|
use std::sync::Arc;
|
|
use sp_runtime::generic::BlockId;
|
|
|
|
fn setup() -> (Arc<TestApi>, Pool<TestApi>) {
|
|
let test_api = Arc::new(TestApi::empty());
|
|
let pool = Pool::new(Default::default(), true.into(), test_api.clone());
|
|
(test_api, pool)
|
|
}
|
|
|
|
#[test]
|
|
fn smoky() {
|
|
let (api, pool) = setup();
|
|
let pool = Arc::new(pool);
|
|
let queue = Arc::new(RevalidationQueue::new(api.clone(), pool.clone()));
|
|
|
|
let uxt = uxt(Alice, 0);
|
|
let uxt_hash = block_on(
|
|
pool.submit_one(&BlockId::number(0), TransactionSource::External, uxt.clone())
|
|
).expect("Should be valid");
|
|
|
|
block_on(queue.revalidate_later(0, vec![uxt_hash]));
|
|
|
|
// revalidated in sync offload 2nd time
|
|
assert_eq!(api.validation_requests().len(), 2);
|
|
// number of ready
|
|
assert_eq!(pool.validated_pool().status().ready, 1);
|
|
} |