fuel_core_client/client/schema/
da_compressed.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use crate::client::schema::{
    schema,
    U32,
};

use super::HexString;

#[derive(cynic::QueryVariables, Debug)]
pub struct DaCompressedBlockByHeightArgs {
    pub height: U32,
}

#[derive(cynic::QueryFragment, Clone, Debug)]
#[cynic(
    schema_path = "./assets/schema.sdl",
    graphql_type = "Query",
    variables = "DaCompressedBlockByHeightArgs"
)]
pub struct DaCompressedBlockByHeightQuery {
    #[arguments(height: $height)]
    pub da_compressed_block: Option<DaCompressedBlock>,
}

/// Block with transaction ids
#[derive(cynic::QueryFragment, Clone, Debug)]
#[cynic(schema_path = "./assets/schema.sdl")]
pub struct DaCompressedBlock {
    pub bytes: HexString,
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn block_by_height_query_gql_output() {
        use cynic::QueryBuilder;
        let operation =
            DaCompressedBlockByHeightQuery::build(DaCompressedBlockByHeightArgs {
                height: U32(0),
            });
        insta::assert_snapshot!(operation.query)
    }
}