lnwire: export ReadElements and WriteElements

In this commit, we export the ReadElements and WriteElements functions.
We do this as exporting these functions makes it possible for outside
packages to define serializations which use the BOLT 1.0 wire format.
This commit is contained in:
Olaoluwa Osuntokun
2018-12-09 18:27:41 -08:00
parent e6623f98b3
commit 4226232881
31 changed files with 125 additions and 125 deletions

View File

@@ -49,7 +49,7 @@ var _ Message = (*ClosingSigned)(nil)
//
// This is part of the lnwire.Message interface.
func (c *ClosingSigned) Decode(r io.Reader, pver uint32) error {
return readElements(r, &c.ChannelID, &c.FeeSatoshis, &c.Signature)
return ReadElements(r, &c.ChannelID, &c.FeeSatoshis, &c.Signature)
}
// Encode serializes the target ClosingSigned into the passed io.Writer
@@ -57,7 +57,7 @@ func (c *ClosingSigned) Decode(r io.Reader, pver uint32) error {
//
// This is part of the lnwire.Message interface.
func (c *ClosingSigned) Encode(w io.Writer, pver uint32) error {
return writeElements(w, c.ChannelID, c.FeeSatoshis, c.Signature)
return WriteElements(w, c.ChannelID, c.FeeSatoshis, c.Signature)
}
// MsgType returns the integer uniquely identifying this message type on the