-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Description
CLI arguments of type Wei might differ from their original input when they are large.
For example, if we set the CLI argument --seed-account-sweep-amount='70000 ether'
execution-spec-tests/src/pytest_plugins/execute/sender.py
Lines 22 to 30 in 4215632
| sender_group.addoption( | |
| "--seed-account-sweep-amount", | |
| action="store", | |
| dest="seed_account_sweep_amount", | |
| type=Wei, | |
| default=None, | |
| help="Amount of wei to sweep from the seed account to the sender account. " | |
| "Default=None (Entire balance)", | |
| ) |
what we actually from seed_account_sweep_amount
execution-spec-tests/src/pytest_plugins/execute/sender.py
Lines 69 to 72 in 4215632
| @pytest.fixture(scope="session") | |
| def seed_account_sweep_amount(request: pytest.FixtureRequest) -> int | None: | |
| """Get the seed account sweep amount.""" | |
| return request.config.option.seed_account_sweep_amount |
is 70000000000000004194304, but the expected value is 70000000000000000000000.
The root cause comes from these float conversions in the Wei class.
execution-spec-tests/src/ethereum_test_base_types/base_types.py
Lines 81 to 87 in 4215632
| value: float | |
| if "**" in value_str: | |
| base, exp = value_str.split("**") | |
| value = float(base) ** int(exp) | |
| else: | |
| value = float(value_str) | |
| return super(Number, cls).__new__(cls, value * multiplier) |
Metadata
Metadata
Assignees
Labels
No labels