Fix compilation errors blocking cargo build --release --target wasm32-unknown-unknown --workspace
- WASM target (
wasm32-unknown-unknown) with#![no_std]constraint panic = "abort"in release profile (no panic catching)#![cfg_attr(not(test), deny(clippy::unwrap_used, clippy::expect_used))]inremitwise-common
- Generated
Cargo.lockviacargo generate-lockfile(fixescheck_ci.shstep 1) - Fixed
remitwise-common/Cargo.toml: removed duplicate[features]section (lines 13–14, 20–21) remitwise-common/src/lib.rs: replacedVec::with_capacity/extend_from_slicewithsoroban_sdk::Bytes::new+extend_from_sliceremitwise-common/src/lib.rs: replacedsoroban_sdk::crypto::ed25519_verify(...)free-function call withenv.crypto().ed25519_verify(...)usingBytesN::from_arrayremitwise-common/src/tests.rs: rewroteed25519::generate/ed25519::signhelpers withed25519-dalek::SigningKey/Signer(dev-dependency only)remitwise-common/src/tests.rs: updatedverify_signaturetests — invalid signature tests changed fromassert_eq!(..., Err(SignatureError::VerificationFailed))to#[should_panic]bill_payments/src/lib.rs: fixed&env→envtype mismatch (line 1722), fixednext_billuse-after-move (line 1772)- This session (Type-Safe Percent Conversion): Implemented
BPS_PER_PERCENT/BASIS_POINTS_PER_PERCENTconstants,Percentnewtype,TryFrom<Percent> for Rate,Rate::from_percent,Rate::to_percent, andRate::has_fractional_percentinremitwise-common. Added 4 unit tests + 1 proptest inremitwise-common/src/tests.rsand createddocs/type-safe-percent-conversion.md. remitwise-common/Cargo.toml: moveded25519-dalekfrom dev-deps to regular deps (version"2") to prevent CI resolving to v3.0.0 (incompatible withsoroban-env-host-21.2.1).insurance/src/lib.rs: fixedsymbol_short!("reactivated")(too long, 11 > 9) →Symbol::new(&env, "reactivated"); fixedPolicyAlreadyInactiveduplicate discriminant12→52; addedclamp_limitto import; removedmutfromlet mut active(no mutation needed); fixedVec::new(&env)→Vec::new(env)inremove_active_policy.data_migration/src/lib.rs: fixedmanual_range_containsclippy lint (version < MIN || version > MAX→!range.contains); gatedENCRYPTED_PAYLOAD_PREFIX_V2with#[cfg(test)](only used in tests).reporting/src/utils.rs: removed invalid#.remittance_split/src/lib.rs: added#[allow(dead_code)]to unusedSTORAGE_OWNER_SCHED_IDS.
cargo check --workspace— clean.remitwise-commonunit tests & proptest forPercentandRate— clean.
- CI (
check_ci.sh) not yet run on CI runner — needs push and PR re-trigger. - 6 pre-existing
emit_tests/assert_event_testsfailures inremitwise-common— not introduced by this PR.
verify_signatureusesenv.crypto().ed25519_verify(...)which panics on verification failure (standard Soroban behavior); theSignatureError::VerificationFailedvariant becomes unreachable- Invalid signature tests use
#[should_panic]instead of assertingErr(VerificationFailed) - Pre-checks (signature length == 64, public key length == 32) still return
Errvariants ed25519-dalek = "2"added as regular dep (not dev-dep) toremitwise-commonto constrain transitive resolution.Cargo.lockcommitted (force-added, bypassing.gitignore). CI regenerates a fresh lockfile each run, butcargo generate-lockfilewithout--workspaceconstraints doesn't consider all workspace members' dep specs, allowinged25519-dalekv3.0.0 to be picked for targets outside the root package graph (e.g.,--package testutils). Committed lockfile ensures every CI job uses v2.2.0 regardless of which target or feature set is built.- Pre-existing warnings in
insurance,data_migration,reporting,remittance_splitfixed prophylactically to avoid CI clippy failures with-D warnings. BPS_PER_PERCENT: u32 = 100andPercent(u32)newtype centralize whole percentage → basis points conversion to prevent ad-hoc arithmetic and potential integer overflow.
/remitwise-common/src/lib.rs:BPS_PER_PERCENT,BASIS_POINTS_PER_PERCENT,Percentstruct,Rate::from_percent,Rate::to_percent,Rate::has_fractional_percent/remitwise-common/src/tests.rs:test_bps_per_percent_constants,test_rate_from_percent,test_rate_to_percent_and_fractional,test_percent_type_conversions,proptest_percent_rate_roundtrip/docs/type-safe-percent-conversion.md: New documentation page/remitwise-common/README.md: Updated documentation forPercent,Rate, and constants/README.md: Linkeddocs/type-safe-percent-conversion.mdin workspace documentation index