From fa1f2f695bb430c740cdcca0bff92af7c1d7b3c7 Mon Sep 17 00:00:00 2001 From: AntiochP <30642645+antiochp@users.noreply.github.com> Date: Wed, 18 Oct 2017 19:23:37 -0400 Subject: [PATCH] we now mine both txs so update test to reflect this (#189) --- pool/src/pool.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pool/src/pool.rs b/pool/src/pool.rs index b25203ca0..2c069f48c 100644 --- a/pool/src/pool.rs +++ b/pool/src/pool.rs @@ -921,9 +921,9 @@ mod tests { let mut mineable_txs = read_pool.prepare_mineable_transactions(3); txs = mineable_txs.drain(..).map(|x| *x).collect(); - // confirm we are only preparing a single tx for mining here - // even though we have 2 txs in the pool - assert_eq!(txs.len(), 1); + // confirm we can preparing both txs for mining here + // one root tx in the pool, and one non-root vertex in the pool + assert_eq!(txs.len(), 2); } let keychain = Keychain::from_random_seed().unwrap(); @@ -941,19 +941,19 @@ mod tests { chain_ref.apply_block(&block); // now reconcile the block + // we should evict both txs here { let mut write_pool = pool.write().unwrap(); let evicted_transactions = write_pool.reconcile_block(&block).unwrap(); - assert_eq!(evicted_transactions.len(), 1); + assert_eq!(evicted_transactions.len(), 2); } // check the pool is consistent after reconciling the block - // we should have 1 tx in the pool and it should - // be in the list of roots (will not be mineable otherwise) + // we should have zero txs in the pool (neither roots nor non-roots) { let read_pool = pool.write().unwrap(); - assert_eq!(read_pool.pool.len_vertices(), 1); - assert_eq!(read_pool.pool.len_roots(), 1); + assert_eq!(read_pool.pool.len_vertices(), 0); + assert_eq!(read_pool.pool.len_roots(), 0); } }