`unwrap!` extracts an inner value or returns an error. `unwrap-panic` terminates the transaction if `none` or `err` is encountered.
clarity (let ((val (unwrap! (some u10) (err u404)))) (ok val))
100 XP to Apprentice
Extracting inner values from optionals and responses.
AI translates the explanation and quiz text while preserving code and answer scoring.
`unwrap!` extracts an inner value or returns an error. `unwrap-panic` terminates the transaction if `none` or `err` is encountered.
clarity (let ((val (unwrap! (some u10) (err u404)))) (ok val))
1. What does unwrap! do when given (none)?
2. What does unwrap-panic do on (err u1)?