fuel-core-client 0.48.0

Tx client and schema specification.
Documentation
use crate::client::schema::{
    U32,
    schema,
};

use super::HexString;

#[derive(cynic::QueryVariables, Debug, Clone)]
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)
    }
}