|
28 | 28 | )
|
29 | 29 |
|
30 | 30 | from eth.abc import (
|
| 31 | + DecodedZeroOrOneLayerRLP, |
31 | 32 | ReceiptAPI,
|
32 | 33 | SignedTransactionAPI,
|
33 | 34 | TransactionBuilderAPI,
|
@@ -254,12 +255,12 @@ def decode(cls, encoded: bytes) -> SignedTransactionAPI:
|
254 | 255 | return cls(type_id, inner_transaction)
|
255 | 256 |
|
256 | 257 | @classmethod
|
257 |
| - def serialize(cls, obj: 'TypedTransaction') -> bytes: |
| 258 | + def serialize(cls, obj: 'TypedTransaction') -> DecodedZeroOrOneLayerRLP: |
258 | 259 | encoded = obj.encode()
|
259 | 260 | return cls.rlp_type.serialize(encoded)
|
260 | 261 |
|
261 | 262 | @classmethod
|
262 |
| - def deserialize(cls, encoded_unchecked: bytes) -> SignedTransactionAPI: |
| 263 | + def deserialize(cls, encoded_unchecked: DecodedZeroOrOneLayerRLP) -> SignedTransactionAPI: |
263 | 264 | # binary checks a few basics, like the length of the bytes
|
264 | 265 | encoded = cls.rlp_type.deserialize(encoded_unchecked)
|
265 | 266 | return cls.decode(encoded)
|
@@ -374,14 +375,14 @@ def decode(cls, encoded: bytes) -> SignedTransactionAPI:
|
374 | 375 | return rlp.decode(encoded, sedes=cls.legacy_signed)
|
375 | 376 |
|
376 | 377 | @classmethod
|
377 |
| - def deserialize(cls, encoded: bytes) -> SignedTransactionAPI: |
| 378 | + def deserialize(cls, encoded: DecodedZeroOrOneLayerRLP) -> SignedTransactionAPI: |
378 | 379 | if isinstance(encoded, bytes):
|
379 | 380 | return TypedTransaction.deserialize(encoded)
|
380 | 381 | else:
|
381 | 382 | return cls.legacy_signed.deserialize(encoded)
|
382 | 383 |
|
383 | 384 | @classmethod
|
384 |
| - def serialize(cls, obj: SignedTransactionAPI) -> bytes: |
| 385 | + def serialize(cls, obj: SignedTransactionAPI) -> DecodedZeroOrOneLayerRLP: |
385 | 386 | if isinstance(obj, TypedTransaction):
|
386 | 387 | return TypedTransaction.serialize(obj)
|
387 | 388 | else:
|
|
0 commit comments