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
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
pub struct ProtocolList {
    pub protocols: Vec<u32>,
}

#[cfg(test)]


mod test {

		use super::*;
		
    #[test]
    fn serialize_protocol_list() {
        let protocols = ProtocolList {
            protocols: vec![1, 3],
        };


        let json_str = serde_json::to_string(&protocols).unwrap();
        assert_eq!(json_str, "{\"protocols\":[1,3]}")
    }
}