@@ -1567,48 +1567,6 @@ pub mod tests {
1567
1567
assert_eq ! ( BlockInfo :: from( block_proposal_2) , block_info) ;
1568
1568
}
1569
1569
1570
- fn system_time_from_ymd_hms_optional (
1571
- year : u32 ,
1572
- month : u32 ,
1573
- day : u32 ,
1574
- hour : u32 ,
1575
- minute : u32 ,
1576
- second : u32 ,
1577
- ) -> Option < SystemTime > {
1578
- use std:: time:: { Duration , UNIX_EPOCH } ;
1579
-
1580
- use chrono:: NaiveDate ;
1581
- // Make sure year is safe to cast
1582
- if year > i32:: MAX as u32 {
1583
- return None ;
1584
- }
1585
- // Cast year to i32 safely
1586
- let year_i32 = year as i32 ;
1587
- let naive =
1588
- NaiveDate :: from_ymd_opt ( year_i32, month, day) ?. and_hms_opt ( hour, minute, second) ?;
1589
-
1590
- let timestamp = naive. timestamp ( ) ;
1591
- if timestamp < 0 {
1592
- return None ;
1593
- }
1594
-
1595
- // Convert to SystemTime
1596
- let duration = timestamp as u64 ;
1597
- Some ( UNIX_EPOCH + Duration :: from_secs ( duration) )
1598
- }
1599
-
1600
- fn system_time_from_ymd_hms (
1601
- year : u32 ,
1602
- month : u32 ,
1603
- day : u32 ,
1604
- hour : u32 ,
1605
- minute : u32 ,
1606
- second : u32 ,
1607
- ) -> SystemTime {
1608
- system_time_from_ymd_hms_optional ( year, month, day, hour, minute, second)
1609
- . expect ( "Invalid system time" )
1610
- }
1611
-
1612
1570
#[ test]
1613
1571
fn test_basic_signer_db ( ) {
1614
1572
let db_path = tmp_db_path ( ) ;
@@ -2581,7 +2539,7 @@ pub mod tests {
2581
2539
} ,
2582
2540
)
2583
2541
. unwrap ( ) ;
2584
- let time_1 = system_time_from_ymd_hms ( 2025 , 4 , 17 , 12 , 30 , 0 ) ;
2542
+ let time_1 = SystemTime :: UNIX_EPOCH ;
2585
2543
2586
2544
let address_2 = StacksAddress :: p2pkh ( false , & StacksPublicKey :: new ( ) ) ;
2587
2545
let update_2 = StateMachineUpdate :: new (
@@ -2594,7 +2552,7 @@ pub mod tests {
2594
2552
} ,
2595
2553
)
2596
2554
. unwrap ( ) ;
2597
- let time_2 = system_time_from_ymd_hms ( 2025 , 4 , 17 , 12 , 30 , 1 ) ;
2555
+ let time_2 = SystemTime :: UNIX_EPOCH + Duration :: from_secs ( 1 ) ;
2598
2556
2599
2557
let address_3 = StacksAddress :: p2pkh ( false , & StacksPublicKey :: new ( ) ) ;
2600
2558
let update_3 = StateMachineUpdate :: new (
@@ -2607,7 +2565,7 @@ pub mod tests {
2607
2565
} ,
2608
2566
)
2609
2567
. unwrap ( ) ;
2610
- let time_3 = system_time_from_ymd_hms ( 2025 , 4 , 17 , 12 , 30 , 10 ) ;
2568
+ let time_3 = SystemTime :: UNIX_EPOCH + Duration :: from_secs ( 10 ) ;
2611
2569
2612
2570
assert_eq ! (
2613
2571
0 ,
0 commit comments