Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
CriesofCarrots committed Jul 13, 2020
1 parent b7fb739 commit 5239ed4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5239ed4

Please sign in to comment.