-
Notifications
You must be signed in to change notification settings - Fork 146
Conversation
21dc89a
to
4c9231b
Compare
4d78c8e
to
84fb90d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👍
Let's merge this monster asap.
state.balances, index, lambda balance, *_: Gwei(balance + delta) | ||
) | ||
) | ||
return state.transform(("balances", index), lambda balance: Gwei(balance + delta)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transfrom
looks good!
@@ -473,7 +483,7 @@ def _determine_next_eth1_votes( | |||
state: BeaconState, config: Eth2Config | |||
) -> Tuple[Eth1Data, ...]: | |||
if (state.slot + 1) % config.SLOTS_PER_ETH1_VOTING_PERIOD == 0: | |||
return tuple() | |||
return HashableList.from_iterable((), state.eth1_data_votes.sedes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, is HashableList(TElement)
compatible with Tuple[Eth1Data, ...]
in typing? I thought HashableList
is Sequence[TElement]
...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no, that's a mistake. I'm quite surprised that mypy didn't catch this. I'll fix the type hint.
@@ -34,7 +34,7 @@ def test_activate_validator( | |||
assert some_validator.activation_epoch == config.GENESIS_EPOCH | |||
else: | |||
some_validator = create_mock_validator( | |||
pubkeys[: validator_count + 1], config, is_active=is_already_activated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
index: ValidatorIndex = default_validator_index, | ||
selection_proof: BLSSignature = EMPTY_SIGNATURE, | ||
aggregate: Attestation = default_attestation, | ||
) -> None: | ||
super().__init__( | ||
) -> TAggregateAndProof: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, for mypy
, is TypeVar
required or we can simply use "AggregateAndProof"
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make a difference if we subclass AggregateAndProof
and don't override the classmethod. Then mypy would think AggregateAndProofSubclass.create
would return a AggregateAndProof
which wouldn't be correct.
84fb90d
to
845604f
Compare
This is the same as #1283. CI got confused with dependency versions, so the tests were failing. I hope that a new PR makes them forget everything and install everything from scratch.
Edit: Didn't work :(
So it for some reason has
pyrsistent==0.15.6
installed even thoughpy-ssz
requirespyrsistent==0.15.4
.Cute Animal Picture