restored original test logic
This commit is contained in:
parent
6b45d453b8
commit
d0151d2b79
|
@ -757,7 +757,6 @@ mod bench {
|
|||
// Create transactions between unrelated parties.
|
||||
let txs = 100_000;
|
||||
let last_ids: Mutex<HashSet<Hash>> = Mutex::new(HashSet::new());
|
||||
let errors: Mutex<usize> = 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<Entry> = 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
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue