Skip to content

fix: add pause guard coverage to insurance mutators#792

Merged
Baskarayelu merged 6 commits into
Remitwise-Org:mainfrom
AbuJulaybeeb:feat/insurance-pause-guard
Jun 19, 2026
Merged

fix: add pause guard coverage to insurance mutators#792
Baskarayelu merged 6 commits into
Remitwise-Org:mainfrom
AbuJulaybeeb:feat/insurance-pause-guard

Conversation

@AbuJulaybeeb

Copy link
Copy Markdown
Contributor

What was done

  • Added PauseAdmin and Paused state management keys to the insurance contract.
  • Implemented global and function-level pause constraints matching other contract architectures (savings_goals, bill_payments).
  • Integrated require_not_paused() guards into create_policy, pay_premium, deactivate_policy and related administrative functions.
  • Resolved compilation issues in insurance/src/test.rs caused by unclosed delimiters and macro corruption.
  • Re-added unintentionally dropped instance TTL constants back to remitwise-common.

Why it was done

To fulfill #714, the insurance contract previously lacked an emergency killswitch mechanism. This modification ensures that any sudden anomalies can be halted globally or per-function by an administrator without risking user funds or corrupted coverage.

How it was verified

  • Verified logic manually by running cargo test -p insurance utilizing newly written coverage for global- and function-level pause guards over mutator actions.

closes #714

@Baskarayelu

Copy link
Copy Markdown
Contributor

pause-guard coverage on the insurance mutators - exactly the circuit-breaker behaviour we wanted verified. merging 👍

@Baskarayelu Baskarayelu merged commit d825735 into Remitwise-Org:main Jun 19, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insurance: add pause/unpause guard coverage for create_policy, pay_premium, and deactivate_policy

2 participants