@@ -862,7 +862,7 @@ mod test {
862862 BatchCommitData , BatchInfo , BlockInfo , L1MessageEnvelope , L2BlockInfoWithL1Messages ,
863863 } ;
864864 use scroll_alloy_consensus:: TxL1Message ;
865- use sea_orm:: { ColumnTrait , EntityTrait , QueryFilter } ;
865+ use sea_orm:: EntityTrait ;
866866
867867 #[ tokio:: test]
868868 async fn test_database_round_trip_batch_commit ( ) {
@@ -1227,11 +1227,13 @@ mod test {
12271227
12281228 #[ tokio:: test]
12291229 async fn test_delete_l1_messages_gt ( ) {
1230+ reth_tracing:: init_test_tracing ( ) ;
1231+
12301232 // Set up the test database.
12311233 let db = setup_test_db ( ) . await ;
12321234
12331235 // Generate unstructured bytes.
1234- let mut bytes = [ 0u8 ; 1024 ] ;
1236+ let mut bytes = [ 0u8 ; 10240 ] ;
12351237 rand:: rng ( ) . fill ( bytes. as_mut_slice ( ) ) ;
12361238 let mut u = Unstructured :: new ( & bytes) ;
12371239
@@ -1276,9 +1278,13 @@ mod test {
12761278
12771279 #[ tokio:: test]
12781280 async fn test_get_l2_block_info_by_number ( ) {
1281+ reth_tracing:: init_test_tracing ( ) ;
1282+
12791283 // Set up the test database.
12801284 let db = setup_test_db ( ) . await ;
12811285
1286+ println ! ( "im here" ) ;
1287+
12821288 // Generate unstructured bytes.
12831289 let mut bytes = [ 0u8 ; 1024 ] ;
12841290 rand:: rng ( ) . fill ( bytes. as_mut_slice ( ) ) ;
@@ -1289,6 +1295,8 @@ mod test {
12891295 let batch_info: BatchInfo = batch_data. clone ( ) . into ( ) ;
12901296 db. insert_batch ( batch_data) . await . unwrap ( ) ;
12911297
1298+ println ! ( "inserted batch" ) ;
1299+
12921300 // Generate and insert multiple L2 blocks
12931301 let mut block_infos = Vec :: new ( ) ;
12941302 for i in 200 ..205 {
@@ -1297,6 +1305,8 @@ mod test {
12971305 }
12981306 db. insert_blocks ( block_infos. clone ( ) , batch_info) . await . unwrap ( ) ;
12991307
1308+ println ! ( "inserted blocks" ) ;
1309+
13001310 // Test getting existing blocks
13011311 for expected_block in block_infos {
13021312 let retrieved_block =
@@ -1475,67 +1485,6 @@ mod test {
14751485 }
14761486 }
14771487
1478- #[ tokio:: test]
1479- async fn test_insert_block_upsert_behavior ( ) {
1480- reth_tracing:: init_test_tracing ( ) ;
1481-
1482- // Set up the test database.
1483- let db = setup_test_db ( ) . await ;
1484-
1485- // Generate unstructured bytes.
1486- let mut bytes = [ 0u8 ; 1024 ] ;
1487- rand:: rng ( ) . fill ( bytes. as_mut_slice ( ) ) ;
1488- let mut u = Unstructured :: new ( & bytes) ;
1489-
1490- // Generate batches
1491- let batch_data_1 = BatchCommitData { index : 100 , ..Arbitrary :: arbitrary ( & mut u) . unwrap ( ) } ;
1492- let batch_info_1: BatchInfo = batch_data_1. clone ( ) . into ( ) ;
1493- let batch_data_2 = BatchCommitData { index : 200 , ..Arbitrary :: arbitrary ( & mut u) . unwrap ( ) } ;
1494- let batch_info_2: BatchInfo = batch_data_2. clone ( ) . into ( ) ;
1495-
1496- db. insert_batch ( batch_data_1) . await . unwrap ( ) ;
1497- db. insert_batch ( batch_data_2) . await . unwrap ( ) ;
1498-
1499- // Insert initial block
1500- let block_info = BlockInfo { number : 600 , hash : B256 :: arbitrary ( & mut u) . unwrap ( ) } ;
1501- db. insert_blocks ( vec ! [ block_info] , batch_info_1) . await . unwrap ( ) ;
1502-
1503- // Verify initial insertion
1504- let retrieved_block = db. get_l2_block_info_by_number ( 600 ) . await . unwrap ( ) ;
1505- assert_eq ! ( retrieved_block, Some ( block_info) ) ;
1506-
1507- // Verify initial batch association using model conversion
1508- let initial_l2_block_model = models:: l2_block:: Entity :: find ( )
1509- . filter ( models:: l2_block:: Column :: BlockNumber . eq ( 600 ) )
1510- . one ( db. inner ( ) . get_connection ( ) )
1511- . await
1512- . unwrap ( )
1513- . unwrap ( ) ;
1514- let ( initial_block_info, initial_batch_info) : ( BlockInfo , BatchInfo ) =
1515- initial_l2_block_model. into ( ) ;
1516- assert_eq ! ( initial_block_info, block_info) ;
1517- assert_eq ! ( initial_batch_info, batch_info_1) ;
1518-
1519- // Update the same block with different batch info (upsert)
1520- db. insert_blocks ( vec ! [ block_info] , batch_info_2) . await . unwrap ( ) ;
1521-
1522- // Verify the block still exists and was updated
1523- let retrieved_block = db. get_l2_block_info_by_number ( 600 ) . await . unwrap ( ) . unwrap ( ) ;
1524- assert_eq ! ( retrieved_block, block_info) ;
1525-
1526- // Verify batch association was updated using model conversion
1527- let updated_l2_block_model = models:: l2_block:: Entity :: find ( )
1528- . filter ( models:: l2_block:: Column :: BlockNumber . eq ( 600 ) )
1529- . one ( db. inner ( ) . get_connection ( ) )
1530- . await
1531- . unwrap ( )
1532- . unwrap ( ) ;
1533- let ( updated_block_info, updated_batch_info) : ( BlockInfo , BatchInfo ) =
1534- updated_l2_block_model. into ( ) ;
1535- assert_eq ! ( updated_block_info, block_info) ;
1536- assert_eq ! ( updated_batch_info, batch_info_2) ;
1537- }
1538-
15391488 #[ tokio:: test]
15401489 async fn test_prepare_on_startup ( ) {
15411490 let db = setup_test_db ( ) . await ;
0 commit comments