cairo_lang_sierra_to_casm/environment/
ap_tracking.rsuse cairo_lang_casm::ap_change::{ApChange, ApChangeError};
use super::ApTracking;
pub fn update_ap_tracking(
ap_tracking: ApTracking,
ap_change: ApChange,
) -> Result<ApTracking, ApChangeError> {
Ok(match (ap_tracking, ap_change) {
(ApTracking::Enabled { ap_change: current, base }, ApChange::Known(change)) => {
ApTracking::Enabled {
ap_change: current.checked_add(change).ok_or(ApChangeError::OffsetOverflow)?,
base,
}
}
_ => ApTracking::Disabled,
})
}