pub fn blocks(
        &self,
        first: Option<i32>,
        last: Option<i32>,
        before: Option<BlockCursor>,
        after: Option<BlockCursor>,
        context: &Context,
    ) -> FieldResult<Option<BlockConnection>> {
        let epoch_data = match self.get_epoch_data(&context.db) {
            Some(epoch_data) => epoch_data,
            None => return Ok(None),
        };

        let lower_bound = context
            .db
            .get_block(&epoch_data.first_block)
            .map(|block| BlockCursor::from(block.expect("The block to be indexed").chain_length))
            .wait()?;

        let upper_bound = context
            .db
            .get_block(&epoch_data.last_block)
            .map(|block| BlockCursor::from(block.expect("The block to be indexed").chain_length))
            .wait()?;

        BlockConnection::new(
            lower_bound,
            upper_bound,
            first,
            last,
            before,
            after,
            &context.db,
        )
        .map(Some)
    }
/// Get a paginated view of all the blocks in this epoch
Get a paginated view of all the blocks in this epoch
Get a paginated view of all the blocks in this epoch
pub fn blocks(
        &self,
        first: Option<i32>,
        last: Option<i32>,
        before: Option<BlockCursor>,
        after: Option<BlockCursor>,
        context: &Context,
    ) -> FieldResult<Option<BlockConnection>> {
        let epoch_data = match self.get_epoch_data(&context.db) {
            Some(epoch_data) => epoch_data,
            None => return Ok(None),
        };
        let lower_bound = context
            .db
            .get_block(&epoch_data.first_block)
            .map(|block| BlockCursor::from(block.expect("The block to be indexed").chain_length))
            .wait()?;
        let upper_bound = context
            .db
            .get_block(&epoch_data.last_block)
            .map(|block| BlockCursor::from(block.expect("The block to be indexed").chain_length))
            .wait()?;
        BlockConnection::new(
            lower_bound,
            upper_bound,
            first,
            last,
            before,
            after,
            &context.db,
        )
        .map(Some)
    }
pub fn blocks ( & self , first : Option < i32 > , last : Option < i32 > , before : Option < BlockCursor > , after : Option < BlockCursor > , context : & Context , ) -> FieldResult < Option < BlockConnection > > { let epoch_data = match self . get_epoch_data ( & context . db ) { Some ( epoch_data ) => epoch_data , None => return Ok ( None ) , } ; let lower_bound = context . db . get_block ( & epoch_data . first_block ) . map ( | block | BlockCursor :: from ( block . expect ( " " ) . chain_length ) ) . wait ( ) ? ; let upper_bound = context . db . get_block ( & epoch_data . last_block ) . map ( | block | BlockCursor :: from ( block . expect ( " " ) . chain_length ) ) . wait ( ) ? ; BlockConnection :: new ( lower_bound , upper_bound , first , last , before , after , & context . db , ) . map ( Some ) }
Get a paginated view of all the blocks in this epoch
Get a paginated view of all the blocks in this epoch
&self
first
Option<i32>
last
Option<i32>
before
Option<BlockCursor>
after
Option<BlockCursor>
context
&Context
&self
first
Option<i32>
last
Option<i32>
before
Option<BlockCursor>
after
Option<BlockCursor>
context
&Context