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 @@ -46,7 +46,7 @@ impl MempoolState<FullState> {
46
46
}
47
47
48
48
impl MempoolState < PartialState > {
49
- fn _with_pool < P > ( pool_txs : P ) -> Self
49
+ fn with_pool < P > ( pool_txs : P ) -> Self
50
50
where
51
51
P : IntoIterator < Item = ThinTransaction > ,
52
52
{
@@ -300,17 +300,20 @@ fn test_new_with_duplicate_tx() {
300
300
301
301
#[ rstest]
302
302
fn test_add_tx_with_duplicate_tx ( mut mempool : Mempool ) {
303
+ // Setup.
303
304
let input = add_tx_input ! ( tip: 50 , tx_hash: Felt :: ONE ) ;
304
- let same_input = input. clone ( ) ;
305
+ let duplicate_input = input. clone ( ) ;
305
306
307
+ // Test.
306
308
add_tx ( & mut mempool, & input) ;
307
-
308
309
assert_matches ! (
309
- mempool. add_tx( same_input . clone ( ) ) ,
310
+ mempool. add_tx( duplicate_input ) ,
310
311
Err ( MempoolError :: DuplicateTransaction { .. } )
311
312
) ;
312
- // Assert that the original tx remains in the pool after the failed attempt.
313
- assert_eq_mempool_queue ( & mempool, & [ same_input. tx ] )
313
+
314
+ // Assert: the original transaction remains.
315
+ let expected_mempool_state = MempoolState :: with_pool ( [ input. tx ] ) ;
316
+ expected_mempool_state. assert_eq_pool_state ( & mempool) ;
314
317
}
315
318
316
319
#[ rstest]
You can’t perform that action at this time.
0 commit comments