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.
Right now most of our funcs check for native-types. For example:
ledger-eth-lib/ledgereth/transactions.py
Lines 51 to 60 in 884a25b
Look into supporting any
rlp.Serializableobjects 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.