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_slice -
remitwise-common/src/lib.rs: replacedsoroban_sdk::crypto::ed25519_verify(...)free-function call withenv.crypto().ed25519_verify(...)usingBytesN::from_array -
remitwise-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. -
This session (Kill Switch Guard — Issue #1289): Added
require_no_active_kill_switch()defence-in-depth guard to block all write operations when the kill switch is active. ImplementedKillSwitchError(typed#[contracterror], discriminantWriteBlocked = 1),STORAGE_KILL_SWITCHstorage key (symbol_short!("KILL_SW")),is_kill_switch_active,require_no_active_kill_switch,activate_kill_switch, anddeactivate_kill_switchinremitwise-common/src/lib.rs. Added 6 unit tests covering happy path, activation, deactivation, idempotency, toggle cycle, and negative test (test_write_blocked_during_active_kill_switch).Applied the guard to ~50+ write entry points across 7 contracts:
bill_payments/src/lib.rs: pay_bill, cancel_bill, restore_bill, batch_pay_bills, execute_due_bill_schedules, add_tags_to_bill, remove_tags_from_bill, pre_upgrade, restore_from_snapshot, discard_snapshot, set_upgrade_admin, set_version, emergency_pause_all, pause, unpause, schedule_unpause, refresh_admin_grant, pause_function, unpause_functioninsurance/src/lib.rs: init, pay_premium, deactivate_policy, archive_policy, restore_policy, batch_pay_premiums, set_pause_admin, pre_upgrade, restore_from_snapshot, discard_snapshot, execute_due_premium_schedulesremittance_split/src/lib.rs: accept_treasury, pre_upgrade, restore_from_snapshot, discard_snapshot, execute_due_remittance_schedules, pause, unpausefamily_wallet/src/lib.rs: add_family_member, remove_family_member, set_emergency_mode, pre_upgrade, restore_from_snapshot, discard_snapshot, pause, unpause, set_upgrade_admin, set_version, batch_remove_family_members, revalidate_proposals, sign_transaction, propose_policy_cancellation, cancel_transaction, archive_old_transactions, cleanup_expired_pending, set_proposal_expirysavings_goals/src/lib.rs: init, pre_upgrade, restore_from_snapshot, discard_snapshot, lock_goal, unlock_goal, archive_goal, restore_goal, execute_due_savings_schedules, cancel_savings_schedule, set_time_lock, add_tags_to_goal, remove_tags_from_goalorchestrator/src/lib.rs: bump_actor_epoch, pre_upgrade, restore_from_snapshot, discard_snapshotreporting/src/lib.rs: init, accept_admin_rotation
Uses
panic_with_error!(&env, e)pattern for Result-returning functions (sinceKillSwitchErroris a cross-crate type that can't use?with contract-specific error types) and.is_err()early-return for non-Result functions. -
This session (Issue #1715 — Role Lifecycle Security): Added 3 security-focused tests to
family_wallet/src/test.rsclosing the pre-merge review gaps:test_role_removal_takes_effect_immediately(removed member rejected at sign gate),test_concurrent_role_demotion_strips_signature_and_blocks_signing(Admin demoted to Viewer → sig stripped, sign blocked),test_unauthorized_viewer_fails_before_mutation(Viewer rejected at auth gate with zero side-effects). Createddocs/issue-1715-role-lifecycle-security.mdwith full PR description, auth-matrix design, backward-compatibility analysis, rollback notes, and validation checklist.
cargonot available in local environment for compilation check.- Code review confirms correctness of pattern and consistency.
- 3 new tests appended to
family_wallet/src/test.rs(lines 8270–8500), total test count now 208 (was 199).
- Needs
cargo check/cargo teston environment with Rust toolchain. - CI (
check_ci.sh) not yet run. - 6 pre-existing
emit_tests/assert_event_testsfailures inremitwise-common— not introduced by this PR.
require_no_active_kill_switchusespanic_with_error!for Result functions and.is_err()for non-Result functions (can't use bare?with cross-crate#[contracterror]types — no blanketFromimplementation)- Kill switch is a simple
booltoggle (unlike investigation epoch which is time-bounded) activate_kill_switch/deactivate_kill_switchdon't enforce auth — callers must gate with admin auth- Cost: a single instance-storage
boolread (~250 gas) — negligible relative to any write entry point
/remitwise-common/src/lib.rs: AddedSTORAGE_KILL_SWITCH,KillSwitchError,is_kill_switch_active,require_no_active_kill_switch,activate_kill_switch,deactivate_kill_switch, and 6 unit tests inkill_switch_testsmodule/bill_payments/src/lib.rs: Addedrequire_no_active_kill_switchguard to 19 write entry points/insurance/src/lib.rs: Added guard to 11 write entry points/remittance_split/src/lib.rs: Added guard to 7 write entry points/family_wallet/src/lib.rs: Added guard to 18 write entry points/savings_goals/src/lib.rs: Added guard to 13 write entry points/orchestrator/src/lib.rs: Added guard to 4 write entry points/reporting/src/lib.rs: Added guard to 2 write entry points