Encapsulate message wire encoding into a module
authorJeffrey Czyz <jkczyz@gmail.com>
Tue, 21 Jan 2020 23:26:21 +0000 (15:26 -0800)
committerJeffrey Czyz <jkczyz@gmail.com>
Wed, 5 Feb 2020 20:11:48 +0000 (12:11 -0800)
commit7de9f5278c75e4da224c175a7c332f4e28471bc1
treeaad58f9855e18991533f7ee0b552010c70f1689a
parentf70058ea4c451955e72b15d24b67d941d7f3e467
Encapsulate message wire encoding into a module

Lightning messages are identified by a 2-byte type when encoded on the
wire. Rather than expecting callers to know message types when sending
messages to peers, have each message implement a trait defining the
message type. Provide an interface for reading and writing messages
as well as a Message enum for matching the decoded message, including
unknown messages.
lightning/src/ln/mod.rs
lightning/src/ln/peer_handler.rs
lightning/src/ln/wire.rs [new file with mode: 0644]