feat: implement admin module and update contract test snapshots#611
Conversation
|
@Oluwasuyi-Timilehin Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@Oluwasuyi-Timilehin fix workflow |
|
Okay will do |
…ow management functionality
|
@Cedarich I already fixed it |
|
@Oluwasuyi-Timilehin |
|
@Cedarich sorry, it has been fiixed now |
|
@Oluwasuyi-Timilehin |
|
@Cedarich it has been fixed |
Cedarich
left a comment
There was a problem hiding this comment.
Hello 👋 please review this PR the changes made are too much 3000+
|
@Cedarich the ci was failing cause of the formatting, and after formatting those were the files changed |
Cedarich
left a comment
There was a problem hiding this comment.
Please can we keep the changes here minimal, only necessary changes
|
@Cedarich only the necessary file has been changed |
|
@Oluwasuyi-Timilehin |
|
@Cedarich it has been fixed |
|
@Oluwasuyi-Timilehin |
|
@Oluwasuyi-Timilehin |
|
@Oluwasuyi-Timilehin |
#closes #569
Pull Request: Diagnostic Pause Reason Codes & Structured Events
This PR improves the debuggability and auditability of the QuickEx contract when operations are paused. It introduces explicit reason codes for global and feature-specific pauses, exposes read-only getters for backends/clients, and emits structured events whenever pause states transition or block an operation.
Key Changes
1. Stable Reason Codes & Storage Mapping
PauseReasonenum in types.rs containing stable discriminant values for common pause contexts (SystemMaintenance = 1,SecurityEmergency = 2,FeatureUpgrade = 3,RegulatoryCompliance = 4,OperatorIntervention = 5).GlobalPauseReason) and granular feature-specific pause reasons (FeaturePauseReasons) in storage.rs.2. Structured Transition & Enforcement Events
Registered three new event schemas in the canonical catalog
EVENT_SCHEMASin events.rs:PauseEnabled: Emitted when a pause state is enabled globally or locally on a feature, recording the admin authorizer, whether it is global, the target feature flag, and the reason code.PauseDisabled: Emitted when a pause state is lifted.PauseEnforced: Emitted inline right before a blocked operation returns a pause error, containing the caller address, blocked action symbol, and the reason code.3. Administrative Interface & Entrypoint Updates
set_paused,pause_features, andunpause_featuresin admin.rs to accept the newreason: u32code argument, persist it, and publish the transition events.get_global_pause_reason(env)andget_feature_pause_reason(env, flag)in lib.rs for clients and backends.PauseEnforcedevents containing the exact active reason code.4. Tests Modification
test_pause_reason_codes_and_eventsto verify the new get/set flow.test_event_snapshot_contract_paused_schemato search specifically for theContractPausedtopic, preventing mismatch failures from the co-emittedPauseEnabledevent.#closes