Commit graph

14 commits

Author SHA1 Message Date
Matt Corallo
f0490118b3 impl some additional (de)serializers, including a u48 wrapper type 2018-10-27 09:42:04 -04:00
Matt Corallo
062a02da1a Add a second Readable trait for state args, clean macros slightly 2018-10-27 09:42:04 -04:00
Matt Corallo
c43e535bc0 Simplify DecodeError enum by removing some useless distinctions 2018-09-20 10:46:12 -04:00
Matt Corallo
3aeec96470 Add module and all-pub-things docs and deny missing docs 2018-09-19 23:07:02 -04:00
Matt Corallo
c91f72c131 Drop MsgEncodable in favor of default fns on Writeable 2018-09-16 14:33:50 -04:00
Matt Corallo
e8a66ef0ea Make Writeable::write typed instead of Writeable
This lets us add some untyped default functions to the trait
2018-09-16 14:33:50 -04:00
Matt Corallo
8322c756cb Stop checking size > 64KB in serialization
This removes a bunch of potentially new error handling in writers
and the checks were kinda useless anyway - in normal operation we
unwrap()ed anyway, and we're gonna want to use the serializtion
framework for ChannelMonitor/ChannelManager serialization, which
may generate things larger than 64KB anyway.
2018-09-16 14:33:50 -04:00
Matt Corallo
712051a9fc Add size_hint in ser and call size_hint in all message serializers 2018-09-16 14:33:50 -04:00
Matt Corallo
ee9533a905 Split out Vec<u8> and Vec<Signature> ser impls cause there's 2
Should resolve any performance issues with Vec<u8> serialization.
2018-09-16 14:33:50 -04:00
Matt Corallo
1f1f82569a Simplify serialization a bit by removing the useless newtypes 2018-09-16 14:33:50 -04:00
Matt Corallo
51ba6ad2e9 Expose (de)serialziers as we'll need them and I don't like warnings 2018-09-16 14:33:48 -04:00
Matt Corallo
d7ed4c63e7 Correct MAX_BUF_SIZE in serialization
I think this might have been my fault due to faulty review
feedback, but fuzzer caught trivial crash here where you try to
send a ping message larger than 16KB (but smaller than the
max-length 64KB) and you crash as message serialization is unwrap()
2018-09-12 13:22:42 -04:00
Matt Corallo
c3e225597d Fix some double-indentation in util/ser 2018-09-12 13:22:42 -04:00
Yuntai Kyong
1b8504a3f3 Implement Writer/Reader
with additional variants in DecodeError
2018-09-12 10:18:02 -04:00