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

chore(fw): add chain id to all fixtures #796

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

Conversation

spencer-tb
Copy link
Contributor

@spencer-tb spencer-tb commented Sep 12, 2024

🗒️ Description

Adds the chain_id as a field for all fixture types. Set to 1 by default unless overwritten in the state/blockchain test environment.

Blockchain/Engine Test Example Json

{
    "tests/shanghai/eip3855_push0/test_push0.py::test_push0_contracts[fork_Shanghai-blockchain_test]": {
        "network": "Shanghai",
        "chainId": "0x01",  # root of the test fixture
        ...

State Test Example Json

{
    "tests/shanghai/eip3855_push0/test_push0.py::test_push0_contracts[fork_Shanghai-state_test]": {
        "chainId": "0x01",  # within the state test env
        "env": {
            "currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
            ...

🔗 Related Issues

N/A

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.

@spencer-tb spencer-tb added type:chore Type: Chore scope:fw Scope: Framework (evm|tools|forks|pytest) labels Sep 12, 2024
@spencer-tb spencer-tb requested a review from marioevz September 12, 2024 22:46
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Thanks, some comments.

src/ethereum_test_fixtures/blockchain.py Outdated Show resolved Hide resolved
src/ethereum_test_fixtures/blockchain.py Outdated Show resolved Hide resolved
src/ethereum_test_specs/blockchain.py Show resolved Hide resolved
@spencer-tb spencer-tb changed the base branch from main to devnet-4-updates October 25, 2024 05:10
@spencer-tb spencer-tb force-pushed the chain-id-fixtures branch 4 times, most recently from a06a1db to 606ac19 Compare October 25, 2024 05:37
Base automatically changed from devnet-4-updates to main October 28, 2024 18:25
@spencer-tb spencer-tb self-assigned this Nov 27, 2024
@winsvega
Copy link
Contributor

So when generating a test with chain_id will all the transactions be of that same chain_id ?
Also we should allow to have tx with different chain id for test purposes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:fw Scope: Framework (evm|tools|forks|pytest) type:chore Type: Chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants