fn insert_attestation(
        &self,
        txn: &Transaction,
        validator_pubkey: &PublicKeyBytes,
        att_source_epoch: Epoch,
        att_target_epoch: Epoch,
        att_signing_root: SigningRoot,
    ) -> Result<(), NotSafe> {
        let validator_id = self.get_validator_id_in_txn(txn, validator_pubkey)?;

        txn.execute(
            "INSERT INTO signed_attestations (validator_id, source_epoch, target_epoch, signing_root)
             VALUES (?1, ?2, ?3, ?4)",
            params![
                validator_id,
                att_source_epoch,
                att_target_epoch,
                att_signing_root.to_hash256().as_bytes()
            ],
        )?;
        Ok(())
    }
/// Insert an attestation into the slashing database.
///
/// This should *only* be called in the same (exclusive) transaction as `check_attestation`
/// so that the check isn't invalidated by a concurrent mutation.
Insert an attestation into the slashing database.
This should *only* be called in the same (exclusive) transaction as `check_attestation`
so that the check isn't invalidated by a concurrent mutation.
Insert an attestation into the slashing database . This should * only * be called in the same ( exclusive ) transaction as ` check_attestation ` so that the check isn ' t invalidated by a concurrent mutation .
fn insert_attestation(
        &self,
        txn: &Transaction,
        validator_pubkey: &PublicKeyBytes,
        att_source_epoch: Epoch,
        att_target_epoch: Epoch,
        att_signing_root: SigningRoot,
    ) -> Result<(), NotSafe> {
        let validator_id = self.get_validator_id_in_txn(txn, validator_pubkey)?;
        txn.execute(
            "INSERT INTO signed_attestations (validator_id, source_epoch, target_epoch, signing_root)
             VALUES (?1, ?2, ?3, ?4)",
            params![
                validator_id,
                att_source_epoch,
                att_target_epoch,
                att_signing_root.to_hash256().as_bytes()
            ],
        )?;
        Ok(())
    }
fn insert_attestation ( & self , txn : & Transaction , validator_pubkey : & PublicKeyBytes , att_source_epoch : Epoch , att_target_epoch : Epoch , att_signing_root : SigningRoot , ) -> Result < ( ) , NotSafe > { let validator_id = self . get_validator_id_in_txn ( txn , validator_pubkey ) ? ; txn . execute ( " " , params ! [ validator_id att_source_epoch att_target_epoch att_signing_root to_hash256 ( ) as_bytes ( ) ] , ) ? ; Ok ( ( ) ) }
Insert an attestation into the slashing database.
Insert an attestation into the slashing database .
&self
txn
&Transaction
validator_pubkey
&PublicKeyBytes
att_source_epoch
Epoch
att_target_epoch
Epoch
att_signing_root
SigningRoot