Skip to main content

fuel_core_client/client/schema/
da_compressed.rs

1use crate::client::schema::{
2    U32,
3    schema,
4};
5
6use super::HexString;
7
8#[derive(cynic::QueryVariables, Debug, Clone)]
9pub struct DaCompressedBlockByHeightArgs {
10    pub height: U32,
11}
12
13#[derive(cynic::QueryFragment, Clone, Debug)]
14#[cynic(
15    schema_path = "./assets/schema.sdl",
16    graphql_type = "Query",
17    variables = "DaCompressedBlockByHeightArgs"
18)]
19pub struct DaCompressedBlockByHeightQuery {
20    #[arguments(height: $height)]
21    pub da_compressed_block: Option<DaCompressedBlock>,
22}
23
24/// Block with transaction ids
25#[derive(cynic::QueryFragment, Clone, Debug)]
26#[cynic(schema_path = "./assets/schema.sdl")]
27pub struct DaCompressedBlock {
28    pub bytes: HexString,
29}
30
31#[cfg(test)]
32mod tests {
33    use super::*;
34
35    #[test]
36    fn block_by_height_query_gql_output() {
37        use cynic::QueryBuilder;
38        let operation =
39            DaCompressedBlockByHeightQuery::build(DaCompressedBlockByHeightArgs {
40                height: U32(0),
41            });
42        insta::assert_snapshot!(operation.query)
43    }
44}