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

Make block_number configurable in genesis header again #2063

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

catoenm
Copy link

@catoenm catoenm commented May 23, 2022

What was wrong?

#2044

How was it fixed?

Fixed according to issue log.

}, False)
)
)
def test_fill_header_params_from_parent(custom_header_params, null_parent,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The test cases look good here. We do try to avoid conditionals in our tests and instead split each test case out into their own test. With conditionals, it can be hard to read what test case ends where and to know which conditional is causing the test to pass over another without debugging the test, etc.

If we can split each test case out into its own test, with an explicit title of the thing it is testing, I think that would be ideal. We can probably factor out the parametrized test cases into a list and pass them into each test if they end up sharing similar info too... something like:

CUSTOM_HEADER_TEST_DATA = (
    {
         'gas_limit': 1,
         'difficulty': 10,
         ...
    },
    { ... },
    { ... },
)

@pytest.mark.parametrize('custom_header_params', CUSTOM_HEADER_TEST_DATA)
def test_case_1(custom_header_params):
     ...
     
@pytest.mark.parametrize('custom_header_params', CUSTOM_HEADER_TEST_DATA)
def test_case_2(custom_header_params):
     ...

Thoughts?

@fselmo
Copy link
Collaborator

fselmo commented May 24, 2022

Thanks for working this @catoenm! This looks good to me. I just left one refactor comment on the tests and then I can add a newsfragment and merge it 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants