Add failing test

(cherry picked from commit 942c019d50)
This commit is contained in:
Tyera Eulberg
2020-07-13 10:08:19 -06:00
committed by Trent Nelson
parent 5f0584b6e8
commit 141a5928c4

View File

@ -6177,6 +6177,21 @@ mod tests {
}
}
#[test]
fn test_blockhash_queue_sysvar_consistency() {
let (genesis_config, _mint_keypair) = create_genesis_config(100_000);
let mut bank = Arc::new(Bank::new(&genesis_config));
goto_end_of_slot(Arc::get_mut(&mut bank).unwrap());
let bhq_account = bank.get_account(&sysvar::recent_blockhashes::id()).unwrap();
let recent_blockhashes =
sysvar::recent_blockhashes::RecentBlockhashes::from_account(&bhq_account).unwrap();
let sysvar_recent_blockhash = recent_blockhashes[0].blockhash;
let bank_last_blockhash = bank.last_blockhash();
assert_eq!(sysvar_recent_blockhash, bank_last_blockhash);
}
#[test]
fn test_bank_inherit_last_vote_sync() {
let (genesis_config, _) = create_genesis_config(500);