cairo_lang_sierra/extensions/modules/starknet/
emit_event.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use super::felt252_span_ty;
use super::syscalls::SyscallGenericLibfunc;
use crate::extensions::SpecializationError;
use crate::extensions::lib_func::SignatureSpecializationContext;

/// Libfunc for an emit event system call.
#[derive(Default)]
pub struct EmitEventLibfunc {}
impl SyscallGenericLibfunc for EmitEventLibfunc {
    const STR_ID: &'static str = "emit_event_syscall";

    fn input_tys(
        context: &dyn SignatureSpecializationContext,
    ) -> Result<Vec<crate::ids::ConcreteTypeId>, SpecializationError> {
        let span_ty = felt252_span_ty(context)?;
        Ok(vec![
            // keys
            span_ty.clone(),
            // data
            span_ty,
        ])
    }

    fn success_output_tys(
        _context: &dyn SignatureSpecializationContext,
    ) -> Result<Vec<crate::ids::ConcreteTypeId>, SpecializationError> {
        Ok(vec![])
    }
}