Skip to content

Commit 23f5c39

Browse files
committed
Fix lint errors
1 parent a8def46 commit 23f5c39

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

tests/helpers/consensus.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def consensus_on_attestation(slashing_db: SlashingDB, attestation_duty: Attestat
3333
The consensus protocol must use `consensus_is_valid_attestation_data` to determine
3434
validity of the proposed attestation value.
3535
"""
36+
# TODO: Use this method in tests instead of dvspec.consensus.consensus_on_attestation
3637
attestation_data = bn_produce_attestation_data(attestation_duty.slot, attestation_duty.committee_index)
3738
assert consensus_is_valid_attestation_data(slashing_db, attestation_data)
3839
return attestation_data
@@ -45,4 +46,5 @@ def consensus_on_block(slashing_db: SlashingDB, proposer_duty: ProposerDuty) ->
4546
The consensus protocol must use `consensus_is_valid_block` to determine
4647
validity of the proposed block value.
4748
"""
49+
# TODO: Implement & use this method in tests instead of dvspec.consensus.consensus_on_block
4850
pass

tests/helpers/eth_node_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def bn_produce_block(slot: Slot, randao_reveal: BLSSignature, graffiti: Bytes32)
8484
"""
8585

8686

87-
def fill_attestation_duties_with_val_index(state: State, attestation_duties: List[AttestationDuty]) -> List[AttestationDuty]:
87+
def fill_attestation_duties_with_val_index(state: State,
88+
attestation_duties: List[AttestationDuty]) -> List[AttestationDuty]:
8889
val_index_to_pubkey = {}
8990
for dv in state.distributed_validators:
9091
val_index_to_pubkey[dv.validator_identity.index] = dv.validator_identity.pubkey
@@ -93,7 +94,6 @@ def fill_attestation_duties_with_val_index(state: State, attestation_duties: Lis
9394
return attestation_duties
9495

9596

96-
9797
def fill_proposer_duties_with_val_index(state: State, proposer_duties: List[ProposerDuty]) -> List[ProposerDuty]:
9898
val_index_to_pubkey = {}
9999
for dv in state.distributed_validators:

tests/helpers/state.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def build_distributed_validator(validator_identity: ValidatorIdentity, num_coval
2323
for i in range(1, num_covalidators):
2424
co_validators.append(CoValidator(validator_identity=validator_identity, pubkey=BLSPubkey(0x00), index=i))
2525
slashing_db = SlashingDB(interchange_format_version=5,
26-
genesis_validators_root=Root(),
27-
data=[])
26+
genesis_validators_root=Root(),
27+
data=[])
2828
distributed_validator = DistributedValidator(validator_identity=validator_identity,
29-
co_validators=co_validators,
30-
slashing_db=slashing_db)
29+
co_validators=co_validators,
30+
slashing_db=slashing_db)
3131
return distributed_validator
3232

3333

tests/helpers/time.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
Time Methods
1818
"""
1919

20+
2021
def time_generator() -> Iterator[int]:
2122
time = GENESIS_TIME
2223
while True:

tests/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
def test_basic_attestation():
2121
state = build_state(5)
2222
time = get_current_time()
23-
23+
2424
current_epoch = compute_epoch_at_time(time)
2525
validator_indices = get_validator_indices(state)
2626
attestation_duties = bn_get_attestation_duties_for_epoch(validator_indices, current_epoch+1)
@@ -32,4 +32,4 @@ def test_basic_attestation():
3232

3333
# TODO: Need to replace dvspec.consensus.consensus_on_attestation with
3434
# tests.helpers.consensus.consensus_on_attestation
35-
serve_attestation_duty(slashing_db, attestation_duty)
35+
serve_attestation_duty(slashing_db, attestation_duty)

0 commit comments

Comments
 (0)