eliminate re-use of a TX here, we're testing for empty account balance (#2576)

This commit is contained in:
Rob Walker 2019-01-28 15:21:08 -08:00 committed by GitHub
parent a2e29fa71f
commit c9bf9ce094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -1510,15 +1510,17 @@ mod tests {
let tx = Transaction::system_new(&keypair1, keypair4.pubkey(), 1, tick.id);
let entry_2 = next_entry(&tick.id, 1, vec![tx]);
assert_eq!(
bank.par_process_entries(&[entry_1.clone(), tick.clone(), entry_2]),
bank.par_process_entries(&[entry_1.clone(), tick.clone(), entry_2.clone()]),
Ok(())
);
assert_eq!(bank.get_balance(&keypair3.pubkey()), 1);
assert_eq!(bank.get_balance(&keypair4.pubkey()), 1);
assert_eq!(bank.last_id(), tick.id);
// ensure that errors are returned
// ensure that an error is returned for an empty account (keypair2)
let tx = Transaction::system_new(&keypair2, keypair3.pubkey(), 1, tick.id);
let entry_3 = next_entry(&entry_2.id, 1, vec![tx]);
assert_eq!(
bank.par_process_entries(&[entry_1]),
bank.par_process_entries(&[entry_3]),
Err(BankError::AccountNotFound)
);
}