Problem
src/kyc/tests.rs contains 35 panic-prone calls (unwrap, expect, or panic!).
Evidence
src/kyc/tests.rs:69 — let amount = BigDecimal::from_str("500.00").unwrap();
src/kyc/tests.rs:70 — let daily_used = BigDecimal::from_str("1000.00").unwrap();
src/kyc/tests.rs:71 — let monthly_used = BigDecimal::from_str("10000.00").unwrap();
src/kyc/tests.rs:78 — let amount = BigDecimal::from_str("2000.00").unwrap(); // Exceeds $1000 limit
src/kyc/tests.rs:79 — let daily_used = BigDecimal::from_str("0.00").unwrap();
Proposed fix
Replace non-essential unwrap/expect usages with typed error propagation and contextual logging. Keep explicit panics only where unrecoverable invariants are well-documented.
Acceptance criteria
- All avoidable panic-prone calls in this file are removed or justified with comments/tests.
- Error paths return typed errors and preserve observability context.
- Existing tests pass (or new tests cover changed paths).
Problem
src/kyc/tests.rscontains 35 panic-prone calls (unwrap,expect, orpanic!).Evidence
src/kyc/tests.rs:69—let amount = BigDecimal::from_str("500.00").unwrap();src/kyc/tests.rs:70—let daily_used = BigDecimal::from_str("1000.00").unwrap();src/kyc/tests.rs:71—let monthly_used = BigDecimal::from_str("10000.00").unwrap();src/kyc/tests.rs:78—let amount = BigDecimal::from_str("2000.00").unwrap(); // Exceeds $1000 limitsrc/kyc/tests.rs:79—let daily_used = BigDecimal::from_str("0.00").unwrap();Proposed fix
Replace non-essential
unwrap/expectusages with typed error propagation and contextual logging. Keep explicit panics only where unrecoverable invariants are well-documented.Acceptance criteria