Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix electra tests and enable testgen #3681

Merged
merged 2 commits into from
Apr 17, 2024
Merged

Fix electra tests and enable testgen #3681

merged 2 commits into from
Apr 17, 2024

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Apr 17, 2024

No description provided.

Comment on lines +365 to +372
if is_post_electra(spec):
assert state.pending_balance_deposits[0].amount == amount
assert state.pending_balance_deposits[0].index == validator_index
else:
# Since withdrawals happen before deposits, it becomes partially withdrawable after state transition.
validator = state.validators[validator_index]
balance = state.balances[validator_index]
assert spec.is_partially_withdrawable_validator(validator, balance)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ralexstokes

with the mainnet preset, it had an error because the top-up got withdrawn during the block processing. I reverted the previous fix and added different expected results; it just checks if the top-up has been appended into pending_balance_deposits.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, sorry about that! this looks good for now, ill make a note to revisit if there is a better way to make this test forward-compatible

Copy link
Member

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! nice work :)

@ralexstokes ralexstokes merged commit 714c54a into dev Apr 17, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants