cairo_lang_sierra/extensions/modules/
ap_tracking.rsuse crate::define_libfunc_hierarchy;
use crate::extensions::lib_func::{
LibfuncSignature, SierraApChange, SignatureSpecializationContext,
};
use crate::extensions::{NoGenericArgsGenericLibfunc, SpecializationError};
define_libfunc_hierarchy! {
pub enum ApTrackingLibfunc {
Revoke(RevokeApTrackingLibfunc),
Enable(EnableApTrackingLibfunc),
Disable(DisableApTrackingLibfunc),
}, ApTrackingConcreteLibfunc
}
#[derive(Default)]
pub struct RevokeApTrackingLibfunc {}
impl NoGenericArgsGenericLibfunc for RevokeApTrackingLibfunc {
const STR_ID: &'static str = "revoke_ap_tracking";
fn specialize_signature(
&self,
_context: &dyn SignatureSpecializationContext,
) -> Result<LibfuncSignature, SpecializationError> {
Ok(LibfuncSignature::new_non_branch(vec![], vec![], SierraApChange::Unknown))
}
}
#[derive(Default)]
pub struct EnableApTrackingLibfunc {}
impl NoGenericArgsGenericLibfunc for EnableApTrackingLibfunc {
const STR_ID: &'static str = "enable_ap_tracking";
fn specialize_signature(
&self,
_context: &dyn SignatureSpecializationContext,
) -> Result<LibfuncSignature, SpecializationError> {
Ok(LibfuncSignature::new_non_branch(vec![], vec![], SierraApChange::Known {
new_vars_only: true,
}))
}
}
#[derive(Default)]
pub struct DisableApTrackingLibfunc {}
impl NoGenericArgsGenericLibfunc for DisableApTrackingLibfunc {
const STR_ID: &'static str = "disable_ap_tracking";
fn specialize_signature(
&self,
_context: &dyn SignatureSpecializationContext,
) -> Result<LibfuncSignature, SpecializationError> {
Ok(LibfuncSignature::new_non_branch(vec![], vec![], SierraApChange::Known {
new_vars_only: true,
}))
}
}