pub fn validator_summary(
        &self,
        public_key: &PublicKeyBytes,
        txn: &Transaction,
    ) -> Result<ValidatorSummary, NotSafe> {
        let validator_id = self.get_validator_id_in_txn(txn, public_key)?;
        let (min_block_slot, max_block_slot) = txn
            .prepare(
                "SELECT MIN(slot), MAX(slot)
                 FROM signed_blocks
                 WHERE validator_id = ?1",
            )?
            .query_row(params![validator_id], |row| Ok((row.get(0)?, row.get(1)?)))?;

        let (
            min_attestation_source,
            min_attestation_target,
            max_attestation_source,
            max_attestation_target,
        ) = txn
            .prepare(
                "SELECT MIN(source_epoch), MIN(target_epoch), MAX(source_epoch), MAX(target_epoch)
                 FROM signed_attestations
                 WHERE validator_id = ?1",
            )?
            .query_row(params![validator_id], |row| {
                Ok((row.get(0)?, row.get(1)?, row.get(2)?, row.get(3)?))
            })?;

        Ok(ValidatorSummary {
            min_block_slot,
            max_block_slot,
            min_attestation_source,
            min_attestation_target,
            max_attestation_source,
            max_attestation_target,
        })
    }
/// Get a summary of a validator's slashing protection data for consumption by the user.
Get a summary of a validator's slashing protection data for consumption by the user.
Get a summary of a validator ' s slashing protection data for consumption by the user .
pub fn validator_summary(
        &self,
        public_key: &PublicKeyBytes,
        txn: &Transaction,
    ) -> Result<ValidatorSummary, NotSafe> {
        let validator_id = self.get_validator_id_in_txn(txn, public_key)?;
        let (min_block_slot, max_block_slot) = txn
            .prepare(
                "SELECT MIN(slot), MAX(slot)
                 FROM signed_blocks
                 WHERE validator_id = ?1",
            )?
            .query_row(params![validator_id], |row| Ok((row.get(0)?, row.get(1)?)))?;
        let (
            min_attestation_source,
            min_attestation_target,
            max_attestation_source,
            max_attestation_target,
        ) = txn
            .prepare(
                "SELECT MIN(source_epoch), MIN(target_epoch), MAX(source_epoch), MAX(target_epoch)
                 FROM signed_attestations
                 WHERE validator_id = ?1",
            )?
            .query_row(params![validator_id], |row| {
                Ok((row.get(0)?, row.get(1)?, row.get(2)?, row.get(3)?))
            })?;
        Ok(ValidatorSummary {
            min_block_slot,
            max_block_slot,
            min_attestation_source,
            min_attestation_target,
            max_attestation_source,
            max_attestation_target,
        })
    }
pub fn validator_summary ( & self , public_key : & PublicKeyBytes , txn : & Transaction , ) -> Result < ValidatorSummary , NotSafe > { let validator_id = self . get_validator_id_in_txn ( txn , public_key ) ? ; let ( min_block_slot , max_block_slot ) = txn . prepare ( " " , ) ? . query_row ( params ! [ validator_id ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) ) ) ? ; let ( min_attestation_source , min_attestation_target , max_attestation_source , max_attestation_target , ) = txn . prepare ( " " , ) ? . query_row ( params ! [ validator_id ] , | row | { Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? , row . get ( 2 ) ? , row . get ( 3 ) ? ) ) } ) ? ; Ok ( ValidatorSummary { min_block_slot , max_block_slot , min_attestation_source , min_attestation_target , max_attestation_source , max_attestation_target , } ) }
Get a summary of a validator's slashing protection data for consumption by the user.
Get a summary of a validator ' s slashing protection data for consumption by the user .
&self
public_key
&PublicKeyBytes
txn
&Transaction