ethereum / execution-specs

Specification for the Execution Layer. Tracking network upgrades.
Creative Commons Zero v1.0 Universal
808 stars 222 forks source link

Re-factor test fixture loader #878

Closed gurukamath closed 3 months ago

gurukamath commented 4 months ago
          Inserting by index looks extremely brittle. Could we do something like:
from dataclass import fields

@dataclass
class Foobar:
    nonce: Optional[Uint]
    gasLimit: Optional[Uint]
    # ...

    def to_list(self) -> List[?]:
        parameters = []
        for name in fields(self):
            value = getattr(self, name)
            if value is None:
                continue
            parameters.append(value)

Or is that overkill?

_Originally posted by @SamWilsn in https://github.com/ethereum/execution-specs/pull/867#discussion_r1475180953_

gurukamath commented 4 months ago

Tracking issue before updating to the latest tests

gurukamath commented 3 months ago

Latest tests have been updated in #908