#[cfg_attr(not(feature = "library"), entry_point)]
pub fn migrate(
    deps: DepsMut,
    _env: Env,
    _msg: Empty,
) -> Result<Response, axelar_wasm_std::error::ContractError> {
    // any version checks should be done before here

    cw2::set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;

    Ok(Response::default())
}
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn migrate(
    deps: DepsMut,
    _env: Env,
    _msg: Empty,
) -> Result<Response, axelar_wasm_std::error::ContractError> {
    use semver::Version;

    // Retrieve the current contract version
    let storage_version = cw2::get_contract_version(deps.storage)?;
    let current_version: Version = storage_version.version.parse()?;
    let new_version: Version = CONTRACT_VERSION.parse()?;

    // Ensure we are migrating from an older version
    if current_version >= new_version {
        return Err(axelar_wasm_std::error::ContractError::Std(
            cosmwasm_std::StdError::generic_err("Cannot migrate from a newer or same contract version"),
        ));
    }

    // Set the new contract version
    cw2::set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;

    Ok(Response::default())
}
