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
use super::*;
use alloc::vec::Vec;

#[derive(Clone, Debug)]
pub struct EventInputAbi {
    pub arg_name: &'static str,
    pub type_name: TypeName,
    pub indexed: bool,
}

#[derive(Clone, Debug)]
pub struct EventAbi {
    pub docs: &'static [&'static str],
    pub identifier: &'static str,
    pub inputs: Vec<EventInputAbi>,
}

impl EventAbi {
    pub fn add_input<T: TypeAbi>(&mut self, arg_name: &'static str, indexed: bool) {
        self.inputs.push(EventInputAbi {
            arg_name,
            type_name: T::type_name(),
            indexed,
        });
    }
}