Skip to content

Commit

Permalink
Add failing test: fresh transaction-status column shouldn't point at …
Browse files Browse the repository at this point in the history
…valid root 0
  • Loading branch information
Tyera Eulberg committed Aug 6, 2020
1 parent 394c0ea commit cbad2a9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6072,6 +6072,23 @@ pub mod tests {
);
}

#[test]
fn test_empty_transaction_status_contains_no_roots() {
let blockstore_path = get_tmp_ledger_path!();
let blockstore = Blockstore::open(&blockstore_path).unwrap();
blockstore.set_roots(&[0]).unwrap();
let index_iterator = blockstore
.transaction_status_cf
.iter(IteratorMode::From(
cf::TransactionStatus::as_index(0),
IteratorDirection::Forward,
))
.unwrap();
for ((_, _, slot), _) in index_iterator {
assert!(!blockstore.is_root(slot));
}
}

#[test]
fn test_get_confirmed_signatures_for_address() {
let blockstore_path = get_tmp_ledger_path!();
Expand Down

0 comments on commit cbad2a9

Please sign in to comment.