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

feat: Add support for all rlp.Serializable derived transactions #49

Open
mikeshultz opened this issue Oct 3, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@mikeshultz
Copy link
Owner

Right now most of our funcs check for native-types. For example:

if isinstance(tx, Transaction):
encoded_tx = encode(tx, Transaction)
elif isinstance(tx, Type1Transaction):
encoded_tx = tx.transaction_type.to_byte() + encode(tx, Type1Transaction)
elif isinstance(tx, Type2Transaction):
encoded_tx = tx.transaction_type.to_byte() + encode(tx, Type2Transaction)
else:
raise ValueError(
"Only Transaction and Type2Transaction objects are currently supported"
)

Look into supporting any rlp.Serializable objects to allow for easier integration. May need to validate the objects for the necessary props/types (Python Protocols could be useful?) to make sure but it should be doable.

@mikeshultz mikeshultz added the enhancement New feature or request label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant