Problem
src/aml/ctr_tests.rs contains 32 panic-prone calls (unwrap, expect, or panic!).
Evidence
src/aml/ctr_tests.rs:21 — let amount1 = Decimal::from_str("1000000").unwrap();
src/aml/ctr_tests.rs:22 — let amount2 = Decimal::from_str("2500000").unwrap();
src/aml/ctr_tests.rs:23 — let amount3 = Decimal::from_str("1500000").unwrap();
src/aml/ctr_tests.rs:26 — assert_eq!(total, Decimal::from_str("5000000").unwrap());
src/aml/ctr_tests.rs:32 — let usd_amount = Decimal::from_str("1000").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/aml/ctr_tests.rscontains 32 panic-prone calls (unwrap,expect, orpanic!).Evidence
src/aml/ctr_tests.rs:21—let amount1 = Decimal::from_str("1000000").unwrap();src/aml/ctr_tests.rs:22—let amount2 = Decimal::from_str("2500000").unwrap();src/aml/ctr_tests.rs:23—let amount3 = Decimal::from_str("1500000").unwrap();src/aml/ctr_tests.rs:26—assert_eq!(total, Decimal::from_str("5000000").unwrap());src/aml/ctr_tests.rs:32—let usd_amount = Decimal::from_str("1000").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