Skip to content

Commit

Permalink
Squash test to test parent bank after squash
Browse files Browse the repository at this point in the history
  • Loading branch information
sakridge committed Feb 26, 2019
1 parent bc2d4c7 commit 599a127
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1450,4 +1450,18 @@ mod tests {
bank.squash();
}
}

#[test]
fn test_bank_get_account_in_parent_after_squash() {
let (genesis_block, mint_keypair) = GenesisBlock::new(500);
let parent = Arc::new(Bank::new(&genesis_block));

let key1 = Keypair::new();

parent.transfer(1, &mint_keypair, key1.pubkey(), genesis_block.last_id()).unwrap();
assert_eq!(parent.get_balance(&key1.pubkey()), 1);
let bank = Bank::new_from_parent(&parent);
bank.squash();
assert_eq!(parent.get_balance(&key1.pubkey()), 1);
}
}

0 comments on commit 599a127

Please sign in to comment.