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

Re-factor test fixture loader #878

Closed
gurukamath opened this issue Feb 5, 2024 · 2 comments
Closed

Re-factor test fixture loader #878

gurukamath opened this issue Feb 5, 2024 · 2 comments
Assignees
Labels
C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty

Comments

@gurukamath
Copy link
Collaborator

          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 #867 (comment)

@gurukamath gurukamath added this to the Post-Cancun Refactoring milestone Feb 5, 2024
@gurukamath gurukamath self-assigned this Feb 7, 2024
@gurukamath gurukamath added C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty labels Feb 7, 2024
@gurukamath
Copy link
Collaborator Author

Tracking issue before updating to the latest tests

@gurukamath
Copy link
Collaborator Author

Latest tests have been updated in #908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty
Projects
None yet
Development

No branches or pull requests

1 participant