Skip to content

Commit

Permalink
fix(execute): Use TransactionDefaults to modify the default chain_id …
Browse files Browse the repository at this point in the history
…for all txs
  • Loading branch information
marioevz committed Jul 23, 2024
1 parent 2ccaecf commit da6a76e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/pytest_plugins/execute/rpc/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import pytest

from ethereum_test_base_types import Number
from ethereum_test_tools import EOA, Hash
from ethereum_test_base_types import Hash, Number
from ethereum_test_tools.rpc import EthRPC
from ethereum_test_types import EOA, TransactionDefaults


def pytest_addoption(parser):
Expand All @@ -31,6 +31,14 @@ def pytest_addoption(parser):
"it's externally increased, the seed transactions might fail."
),
)
remote_rpc_group.addoption(
"--rpc-chain-id",
action="store",
dest="rpc_chain_id",
type=int,
default=None,
help="ID of the chain where the tests will be executed.",
)
remote_rpc_group.addoption(
"--tx-wait-timeout",
action="store",
Expand All @@ -55,6 +63,9 @@ def eth_rpc(request, rpc_endpoint: str) -> EthRPC:
Initialize ethereum RPC client for the execution client under test.
"""
tx_wait_timeout = request.config.getoption("tx_wait_timeout")
chain_id = request.config.getoption("rpc_chain_id")
if chain_id is not None:
TransactionDefaults.chain_id = chain_id
return EthRPC(rpc_endpoint, transaction_wait_timeout=tx_wait_timeout)


Expand Down

0 comments on commit da6a76e

Please sign in to comment.