diff --git a/bindings/src/account_history/msg/execute.rs b/bindings/src/account_history/msg/execute.rs index d44758fe..4af4ee62 100644 --- a/bindings/src/account_history/msg/execute.rs +++ b/bindings/src/account_history/msg/execute.rs @@ -14,4 +14,5 @@ pub enum ExecuteMsg { CleanStorage { limit: u64, }, + CleanStorageBulk {}, } diff --git a/contracts/account-history-contract/src/entry_point/execute.rs b/contracts/account-history-contract/src/entry_point/execute.rs index 1f9810cc..de7a742b 100644 --- a/contracts/account-history-contract/src/entry_point/execute.rs +++ b/contracts/account-history-contract/src/entry_point/execute.rs @@ -4,8 +4,8 @@ use elys_bindings::{account_history::msg::ExecuteMsg, ElysMsg, ElysQuery}; use crate::{ action::execute::{add_user_address_to_queue, clean_up_storage}, states::{ - DELETE_EPOCH, DELETE_OLD_DATA_ENABLED, PARAMS_ADMIN, PROCESSED_ACCOUNT_PER_BLOCK, - TRADE_SHIELD_ADDRESS, UPDATE_ACCOUNT_ENABLED, + DELETE_EPOCH, DELETE_OLD_DATA_ENABLED, HISTORY, OLD_HISTORY_2, PARAMS_ADMIN, + PROCESSED_ACCOUNT_PER_BLOCK, TRADE_SHIELD_ADDRESS, UPDATE_ACCOUNT_ENABLED, }, }; @@ -64,5 +64,13 @@ pub fn execute( let resp = clean_up_storage(&mut deps, limit)?; Ok(resp) } + ExecuteMsg::CleanStorageBulk {} => { + if info.sender != PARAMS_ADMIN.load(deps.storage)? { + return Err(StdError::generic_err("Unauthorized")); + } + HISTORY.clear(deps.storage); + OLD_HISTORY_2.clear(deps.storage); + Ok(Response::new()) + } } }