@@ -20,7 +20,9 @@ fn test_older_with_invalid_rellocktime_too_large() {
2020 ) ;
2121
2222 // Check that it's the right kind of error
23- if let Err ( descriptor:: DescriptorError :: Miniscript ( miniscript:: Error :: RelativeLockTime ( _) ) ) = result {
23+ if let Err ( descriptor:: DescriptorError :: Miniscript ( miniscript:: Error :: RelativeLockTime ( _) ) ) =
24+ result
25+ {
2426 } else {
2527 panic ! ( "Expected RelLockTime error, got {:?}" , result) ;
2628 }
@@ -91,30 +93,30 @@ fn test_rel_lock_time_error() {
9193 let invalid_value = 0x80000000u32 ;
9294 let rel_lock_time_result = miniscript:: RelLockTime :: from_consensus ( invalid_value) ;
9395 assert ! ( rel_lock_time_result. is_err( ) ) ;
94-
96+
9597 let rel_lock_time_error = rel_lock_time_result. unwrap_err ( ) ;
96-
98+
9799 // 2. Wrap it in the Miniscript error variant (matching your new macro logic)
98100 let minisc_err = miniscript:: Error :: RelativeLockTime ( rel_lock_time_error) ;
99-
101+
100102 // 3. Test the From impl (Miniscript -> DescriptorError)
101103 let error: descriptor:: DescriptorError = minisc_err. into ( ) ;
102-
104+
103105 // Check that it matches the nested structure
104106 assert ! ( matches!(
105- error,
107+ error,
106108 descriptor:: DescriptorError :: Miniscript ( miniscript:: Error :: RelativeLockTime ( _) )
107109 ) ) ;
108110
109111 // 4. Test the Display impl
110112 let display_string = format ! ( "{}" , error) ;
111-
112- // FIX: Since the error is now wrapped in DescriptorError::Miniscript,
113+
114+ // FIX: Since the error is now wrapped in DescriptorError::Miniscript,
113115 // the string likely starts with "Miniscript error:" or similar.
114116 // Using .contains() is more robust for nested errors.
115117 assert ! (
116118 display_string. contains( "relative locktime" ) ,
117- "Display string was: '{}'" , display_string
119+ "Display string was: '{}'" ,
120+ display_string
118121 ) ;
119122}
120-
0 commit comments