mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 03:42:46 +00:00
Add comments to block_processing code
This commit is contained in:
@@ -1,22 +1,26 @@
|
||||
use crate::errors::{DepositInvalid as Invalid, DepositValidationError as Error};
|
||||
use ssz::TreeHash;
|
||||
use types::beacon_state::helpers::verify_bitfield_length;
|
||||
use types::*;
|
||||
|
||||
/// Verify validity of ``slashable_attestation`` fields.
|
||||
/// Indicates if a `Deposit` is valid to be included in a block in the current epoch of the given
|
||||
/// state.
|
||||
///
|
||||
/// Returns `Ok(())` if all fields are valid.
|
||||
/// Returns `Ok(())` if the `Deposit` is valid, otherwise indicates the reason for invalidity.
|
||||
///
|
||||
/// Note: this function is incomplete.
|
||||
///
|
||||
/// Spec v0.4.0
|
||||
pub fn verify_deposit(
|
||||
state: &BeaconState,
|
||||
deposit: &Deposit,
|
||||
spec: &ChainSpec,
|
||||
_spec: &ChainSpec,
|
||||
) -> Result<(), Error> {
|
||||
// TODO: verify serialized deposit data.
|
||||
|
||||
// TODO: verify deposit index.
|
||||
verify!(deposit.index == state.deposit_index, Invalid::BadIndex);
|
||||
verify!(
|
||||
deposit.index == state.deposit_index,
|
||||
Invalid::BadIndex(state.deposit_index, deposit.index)
|
||||
);
|
||||
|
||||
// TODO: verify merkle branch.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user