@@ -275,17 +275,17 @@ fn test_emit_stx_burn_nok() {
275
275
fn test_emit_nested_print_nok ( ) {
276
276
// The original code had two problems:
277
277
// 1. emit-event-ok called emit-event-nok without handling the (err u1)
278
- // response, causing "UncheckedIntermediaryResponses" error during
278
+ // response, causing "UncheckedIntermediaryResponses" error during
279
279
// contract initialization.
280
- // 2. The test incorrectly expected (ok u1) and 1 event, but when a public
281
- // function returns an error, the entire transaction rolls back and no
280
+ // 2. The test incorrectly expected (ok u1) and 1 event, but when a public
281
+ // function returns an error, the entire transaction rolls back and no
282
282
// events are emitted.
283
283
//
284
284
// Fixed by:
285
285
// - Adding try! to properly handle the error response from emit-event-nok.
286
- // - Adding an if statement to make both code paths valid for contract
286
+ // - Adding an if statement to make both code paths valid for contract
287
287
// initialization.
288
- // - Updating test expectations to match actual behavior: (err u1) and 0
288
+ // - Updating test expectations to match actual behavior: (err u1) and 0
289
289
// events.
290
290
//
291
291
// This test demonstrates that when a public function returns an error,
@@ -312,7 +312,7 @@ fn test_emit_nested_print_nok() {
312
312
// try! propagates the error from emit-event-nok, so emit-event-ok returns (err u1).
313
313
assert_eq ! ( value, Value :: error( Value :: UInt ( 1 ) ) . unwrap( ) ) ;
314
314
// No events are emitted because when a public function returns an error,
315
- // Clarity rolls back the entire transaction, discarding all side effects
315
+ // Clarity rolls back the entire transaction, discarding all side effects
316
316
// including print statements.
317
317
assert_eq ! ( events. len( ) , 0 ) ;
318
318
}
0 commit comments