From de358d537378836ee518644e5e256fe71f1e922a Mon Sep 17 00:00:00 2001 From: Robert Kelly Date: Wed, 2 May 2018 12:04:05 -0400 Subject: [PATCH] restored original test logic --- src/accountant_skel.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/accountant_skel.rs b/src/accountant_skel.rs index 0c31c2b20adc7d..c5969fe0974c4c 100644 --- a/src/accountant_skel.rs +++ b/src/accountant_skel.rs @@ -757,7 +757,6 @@ mod bench { // Create transactions between unrelated parties. let txs = 100_000; let last_ids: Mutex> = Mutex::new(HashSet::new()); - let errors: Mutex = Mutex::new(0); let transactions: Vec<_> = (0..txs) .into_par_iter() .map(|i| { @@ -775,16 +774,10 @@ mod bench { // Seed the 'from' account. let rando0 = KeyPair::new(); let tr = Transaction::new(&mint.keypair(), rando0.pubkey(), 1_000, last_id); - // some of these will fail because balance updates before transaction completes - match acc.process_verified_transaction(&tr) { - Ok(_) => (), - Err(_) => *errors.lock().unwrap() += 1, - }; + let _ = acc.process_verified_transaction(&tr); let rando1 = KeyPair::new(); let tr = Transaction::new(&rando0, rando1.pubkey(), 2, last_id); - // these will fail if the prior transaction does not go through - // but won't typically fail otherwise since the addresses are randomly generated let _ = acc.process_verified_transaction(&tr); // Finally, return a transaction that's unique @@ -811,7 +804,7 @@ mod bench { let entries: Vec = skel.historian.receiver.iter().collect(); assert_eq!(entries.len(), 1); assert_eq!( - entries[0].events.len() + *errors.lock().unwrap(), + entries[0].events.len(), txs as usize );