Fix type hinting

This commit is contained in:
Hsiao-Wei Wang 2019-03-02 13:48:46 +08:00
parent b8d1003c2c
commit 00804da13e
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
1 changed files with 3 additions and 3 deletions

View File

@ -1633,7 +1633,7 @@ For each `proposer_slashing` in `block.body.proposer_slashings`, run the followi
```python ```python
def process_proposer_slashing(state: BeaconState, def process_proposer_slashing(state: BeaconState,
proposer_slashing: ProposerSlashing): proposer_slashing: ProposerSlashing) -> None:
proposer = state.validator_registry[proposer_slashing.proposer_index] proposer = state.validator_registry[proposer_slashing.proposer_index]
# Verify that the slot is the same # Verify that the slot is the same
assert proposer_slashing.proposal_1.slot == proposer_slashing.proposal_2.slot assert proposer_slashing.proposal_1.slot == proposer_slashing.proposal_2.slot
@ -1662,7 +1662,7 @@ For each `attester_slashing` in `block.body.attester_slashings`, run the followi
```python ```python
def process_attester_slashing(state: BeaconState, def process_attester_slashing(state: BeaconState,
attester_slashing: AttesterSlashing): attester_slashing: AttesterSlashing) -> None:
attestation1 = attester_slashing.slashable_attestation_1 attestation1 = attester_slashing.slashable_attestation_1
attestation2 = attester_slashing.slashable_attestation_2 attestation2 = attester_slashing.slashable_attestation_2
# Check that the attestations are conflicting # Check that the attestations are conflicting
@ -1828,7 +1828,7 @@ Verify that `len(block.body.transfers) <= MAX_TRANSFERS` and that all transfers
For each `transfer` in `block.body.transfers`, run the following function: For each `transfer` in `block.body.transfers`, run the following function:
```python ```python
def process_exit(state: BeaconState,transfer: Transfer) -> None: def process_exit(state: BeaconState, transfer: Transfer) -> None:
# Verify the amount and fee aren't individually too big (for anti-overflow purposes) # Verify the amount and fee aren't individually too big (for anti-overflow purposes)
assert state.validator_balances[transfer.from] >= max(transfer.amount, transfer.fee) assert state.validator_balances[transfer.from] >= max(transfer.amount, transfer.fee)
# Verify that we have enough ETH to send, and that after the transfer the balance will be either # Verify that we have enough ETH to send, and that after the transfer the balance will be either