File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ impl MempoolState<FullState> {
49
49
}
50
50
51
51
impl MempoolState < PartialState > {
52
- fn _with_pool < P > ( pool_txs : P ) -> Self
52
+ fn with_pool < P > ( pool_txs : P ) -> Self
53
53
where
54
54
P : IntoIterator < Item = ThinTransaction > ,
55
55
{
@@ -305,17 +305,20 @@ fn test_new_with_duplicate_tx() {
305
305
306
306
#[ rstest]
307
307
fn test_add_tx_with_duplicate_tx ( mut mempool : Mempool ) {
308
+ // Setup.
308
309
let input = add_tx_input ! ( tip: 50 , tx_hash: Felt :: ONE ) ;
309
- let same_input = input. clone ( ) ;
310
+ let duplicate_input = input. clone ( ) ;
310
311
312
+ // Test.
311
313
add_tx ( & mut mempool, & input) ;
312
-
313
314
assert_matches ! (
314
- mempool. add_tx( same_input . clone ( ) ) ,
315
+ mempool. add_tx( duplicate_input ) ,
315
316
Err ( MempoolError :: DuplicateTransaction { .. } )
316
317
) ;
317
- // Assert that the original tx remains in the pool after the failed attempt.
318
- assert_eq_mempool_queue ( & mempool, & [ same_input. tx ] )
318
+
319
+ // Assert: the original transaction remains.
320
+ let expected_mempool_state = MempoolState :: with_pool ( [ input. tx ] ) ;
321
+ expected_mempool_state. assert_eq_pool_state ( & mempool) ;
319
322
}
320
323
321
324
#[ rstest]
You can’t perform that action at this time.
0 commit comments