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
30
31
32
33
use crate::*;

#[derive(
    Clone,
    Debug,
    Eq,
    Ord,
    PartialEq,
    PartialOrd,
    Hash,
    serde::Serialize,
    serde::Deserialize,
    JsonSchema,
)]
#[wasm_bindgen]
pub struct GovernanceActionIds(pub(crate) Vec<GovernanceActionId>);

to_from_json!(GovernanceActionIds);

#[wasm_bindgen]
impl GovernanceActionIds {
    pub fn new() -> Self {
        Self(Vec::new())
    }

    pub fn get(&self, index: usize) -> Option<GovernanceActionId> {
        self.0.get(index).cloned()
    }

    pub fn len(&self) -> usize {
        self.0.len()
    }
}