fix secondary index test (#17111)
This commit is contained in:
parent
c616c34825
commit
a6a1355b80
|
@ -2912,8 +2912,8 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&mut vec![],
|
&mut vec![],
|
||||||
);
|
);
|
||||||
assert!(index.spl_token_mint_index.index.is_empty());
|
assert!(secondary_index.index.is_empty());
|
||||||
assert!(index.spl_token_mint_index.reverse_index.is_empty());
|
assert!(secondary_index.reverse_index.is_empty());
|
||||||
|
|
||||||
// Wrong account data size
|
// Wrong account data size
|
||||||
index.upsert(
|
index.upsert(
|
||||||
|
@ -2925,8 +2925,8 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&mut vec![],
|
&mut vec![],
|
||||||
);
|
);
|
||||||
assert!(index.spl_token_mint_index.index.is_empty());
|
assert!(secondary_index.index.is_empty());
|
||||||
assert!(index.spl_token_mint_index.reverse_index.is_empty());
|
assert!(secondary_index.reverse_index.is_empty());
|
||||||
|
|
||||||
// Just right. Inserting the same index multiple times should be ok
|
// Just right. Inserting the same index multiple times should be ok
|
||||||
for _ in 0..2 {
|
for _ in 0..2 {
|
||||||
|
@ -2940,15 +2940,19 @@ pub mod tests {
|
||||||
check_secondary_index_unique(secondary_index, slot, &index_key, &account_key);
|
check_secondary_index_unique(secondary_index, slot, &index_key, &account_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// included
|
||||||
|
assert!(!secondary_index.index.is_empty());
|
||||||
|
assert!(!secondary_index.reverse_index.is_empty());
|
||||||
|
|
||||||
index
|
index
|
||||||
.get_account_write_entry(&account_key)
|
.get_account_write_entry(&account_key)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.slot_list_mut(|slot_list| slot_list.clear());
|
.slot_list_mut(|slot_list| slot_list.clear());
|
||||||
|
|
||||||
// Everything should be deleted
|
// Everything should be deleted
|
||||||
index.handle_dead_keys(&[&account_key], account_index);
|
index.handle_dead_keys(&[&account_key], &account_index);
|
||||||
assert!(index.spl_token_mint_index.index.is_empty());
|
assert!(secondary_index.index.is_empty());
|
||||||
assert!(index.spl_token_mint_index.reverse_index.is_empty());
|
assert!(secondary_index.reverse_index.is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue