chia-blockchain/chia/protocols
Richard Kiss b084813b12
Improve streamable (#3031)
* Avoid importing `test_constants` as it takes a long time.

* Factor out `parse_*` functions.

* First crack at refactoring `Streamable.parse`.

* Don't add `_parse_functions` attribute to `Streamable`.

This no longer requires an extra `_parse_functions` attribute on a
`Streamable`, as it may be confusing serializers or other functions
that use `__annotations__`.

* Fix lint problems with `black`.

* Fix `parse_tuple`.

* Defer some parsing failures to parse time rather than class-creation time.

* Tidy up & remove some obsolete stuff.

* Decorate `RequestBlocks` as `streamable`.

* Fix wrong uses of Streamable class

Revert an earlier commit and error out on class creation in case a
Streamable subclass is instantiated incorrectly, e.g. containing a
non-serializable member.

Fix cases where Streamable parent class was forgotten.

* Fix wrong types when creating DerivationRecord and WalletCoinRecord

* additional unit tests for streamable parsers

* add type annotations (#3222)

Co-authored-by: Rostislav <rostislav@users.noreply.github.com>
Co-authored-by: arvidn <arvid@libtorrent.org>
2021-04-30 10:22:11 -07:00
..
__init__.py `git mv src chia` 2021-04-04 21:41:39 -07:00
farmer_protocol.py `git mv src chia` 2021-04-04 21:41:39 -07:00
full_node_protocol.py Improve streamable (#3031) 2021-04-30 10:22:11 -07:00
harvester_protocol.py `git mv src chia` 2021-04-04 21:41:39 -07:00
introducer_protocol.py `git mv src chia` 2021-04-04 21:41:39 -07:00
pool_protocol.py `git mv src chia` 2021-04-04 21:41:39 -07:00
protocol_message_types.py Removes warnings by renaming some protocol messages. Also improves error handling for timelord. 2021-04-04 23:54:11 -07:00
shared_protocol.py `git mv src chia` 2021-04-04 21:41:39 -07:00
timelord_protocol.py Improve streamable (#3031) 2021-04-30 10:22:11 -07:00
wallet_protocol.py `git mv src chia` 2021-04-04 21:41:39 -07:00