Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions contracts/predictify-hybrid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

// Module declarations - all modules enabled
mod admin;
#[cfg(test)]
mod admin_auth_audit_tests;
pub mod audit_trail;
mod balances;
mod batch_operations;
Expand All @@ -42,6 +44,7 @@ mod markets;
mod metadata_limits;
#[cfg(test)]
mod metadata_limits_tests;
mod monitoring;
#[cfg(test)]
mod multi_admin_multisig_tests;
#[cfg(test)]
Expand Down Expand Up @@ -5370,6 +5373,21 @@ impl PredictifyHybrid {
.unwrap_or_else(|_| String::from_str(&env, "unknown"))
}

/// Remove the oldest `count` completed recovery history entries for a market (admin only).
///
/// Active (unresolved) recovery state is never pruned. `count` is capped at 30.
///
/// # Errors
/// * `Unauthorized` - Caller is not admin
pub fn prune_recovery_history(
env: Env,
admin: Address,
market_id: Symbol,
count: u32,
) -> Result<u32, Error> {
crate::recovery::RecoveryManager::prune_recovery_history(&env, &admin, &market_id, count)
}

// ===== VERSIONING FUNCTIONS =====

/// Track contract version for versioning system
Expand Down
Loading
Loading