test_bank_squash: validate transaction_count() before/after squashing
This commit is contained in:
parent
05646d72b8
commit
dad1511484
|
@ -1418,10 +1418,14 @@ mod tests {
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
assert_eq!(parent.process_transaction(&tx_move_mint_to_1), Ok(()));
|
assert_eq!(parent.process_transaction(&tx_move_mint_to_1), Ok(()));
|
||||||
|
assert_eq!(parent.transaction_count(), 1);
|
||||||
|
|
||||||
let bank = Bank::new_from_parent(&parent);
|
let bank = Bank::new_from_parent(&parent);
|
||||||
|
assert_eq!(bank.transaction_count(), 0);
|
||||||
let tx_move_1_to_2 =
|
let tx_move_1_to_2 =
|
||||||
SystemTransaction::new_move(&key1, key2.pubkey(), 1, genesis_block.last_id(), 0);
|
SystemTransaction::new_move(&key1, key2.pubkey(), 1, genesis_block.last_id(), 0);
|
||||||
assert_eq!(bank.process_transaction(&tx_move_1_to_2), Ok(()));
|
assert_eq!(bank.process_transaction(&tx_move_1_to_2), Ok(()));
|
||||||
|
assert_eq!(bank.transaction_count(), 1);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parent.get_signature_status(&tx_move_1_to_2.signatures[0]),
|
parent.get_signature_status(&tx_move_1_to_2.signatures[0]),
|
||||||
None
|
None
|
||||||
|
@ -1443,6 +1447,9 @@ mod tests {
|
||||||
|
|
||||||
// works iteration 0, no-ops on iteration 1 and 2
|
// works iteration 0, no-ops on iteration 1 and 2
|
||||||
bank.squash();
|
bank.squash();
|
||||||
|
|
||||||
|
assert_eq!(parent.transaction_count(), 1);
|
||||||
|
assert_eq!(bank.transaction_count(), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue