Skip to content

Commit

Permalink
updates affected tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arya2 committed Oct 16, 2024
1 parent ce6d169 commit f897489
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions zebrad/src/components/mempool/storage/tests/prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ proptest! {
});

for rejection in unique_ids {
storage.reject(rejection.mined_id(), SameEffectsTipRejectionError::SpendConflict.into());
storage.reject(rejection, SameEffectsTipRejectionError::SpendConflict.into());
}

// Make sure there were no duplicates
Expand Down Expand Up @@ -135,7 +135,7 @@ proptest! {
});

for rejection in unique_ids {
storage.reject(rejection.mined_id(), SameEffectsChainRejectionError::RandomlyEvicted.into());
storage.reject(rejection, SameEffectsChainRejectionError::RandomlyEvicted.into());
}

// Make sure there were no duplicates
Expand Down Expand Up @@ -202,7 +202,7 @@ proptest! {
});

for (index, rejection) in unique_ids.enumerate() {
storage.reject(rejection.mined_id(), rejection_error.clone());
storage.reject(rejection, rejection_error.clone());

if index == MAX_EVICTION_MEMORY_ENTRIES - 1 {
// Make sure there were no duplicates
Expand Down Expand Up @@ -249,9 +249,9 @@ proptest! {
rejection_template
}).collect();

storage.reject(unique_ids[0].mined_id(), SameEffectsChainRejectionError::RandomlyEvicted.into());
storage.reject(unique_ids[0], SameEffectsChainRejectionError::RandomlyEvicted.into());
thread::sleep(Duration::from_millis(11));
storage.reject(unique_ids[1].mined_id(), SameEffectsChainRejectionError::RandomlyEvicted.into());
storage.reject(unique_ids[1], SameEffectsChainRejectionError::RandomlyEvicted.into());

prop_assert_eq!(storage.rejected_transaction_count(), 1);
}
Expand Down Expand Up @@ -288,7 +288,7 @@ proptest! {
Err(MempoolError::StorageEffectsTip(SameEffectsTipRejectionError::SpendConflict))
);

prop_assert!(storage.contains_rejected(&id_to_reject.mined_id()));
prop_assert!(storage.contains_rejected(&id_to_reject));

storage.clear();
}
Expand Down Expand Up @@ -341,7 +341,7 @@ proptest! {
Err(MempoolError::StorageEffectsTip(SameEffectsTipRejectionError::SpendConflict))
);

prop_assert!(storage.contains_rejected(&id_to_reject.mined_id()));
prop_assert!(storage.contains_rejected(&id_to_reject));

prop_assert_eq!(
storage.insert(second_transaction_to_accept, Vec::new()),
Expand Down Expand Up @@ -387,7 +387,7 @@ proptest! {
let num_removals = storage.reject_and_remove_same_effects(mined_ids_to_remove, vec![]);
for &removed_transaction_id in mined_ids_to_remove.iter() {
prop_assert_eq!(
storage.rejection_error(&removed_transaction_id),
storage.rejection_error(&UnminedTxId::Legacy(removed_transaction_id)),
Some(SameEffectsChainRejectionError::Mined.into())
);
}
Expand Down
4 changes: 2 additions & 2 deletions zebrad/src/components/mempool/storage/tests/vectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ fn mempool_storage_crud_same_effects_mainnet() {

// Check that it's rejection is cached in the chain_rejected_same_effects' `Mined` eviction list.
assert_eq!(
storage.rejection_error(&unmined_tx_1.transaction.id.mined_id()),
storage.rejection_error(&unmined_tx_1.transaction.id),
Some(SameEffectsChainRejectionError::Mined.into())
);
assert_eq!(
Expand Down Expand Up @@ -226,7 +226,7 @@ fn mempool_storage_crud_same_effects_mainnet() {

// Check that it's rejection is cached in the chain_rejected_same_effects' `SpendConflict` eviction list.
assert_eq!(
storage.rejection_error(&unmined_tx_2.transaction.id.mined_id()),
storage.rejection_error(&unmined_tx_2.transaction.id),
Some(SameEffectsChainRejectionError::DuplicateSpend.into())
);
assert_eq!(
Expand Down

0 comments on commit f897489

Please sign in to comment.