diff --git a/lnwire/lnwire.go b/lnwire/lnwire.go index 8d12d60b2..5631890ea 100644 --- a/lnwire/lnwire.go +++ b/lnwire/lnwire.go @@ -152,7 +152,7 @@ func writeElement(w io.Writer, element interface{}) error { } var b [64]byte - err := serializeSigToWire(&b, e) + err := SerializeSigToWire(&b, e) if err != nil { return err } @@ -467,7 +467,7 @@ func readElement(r io.Reader, element interface{}) error { if _, err := io.ReadFull(r, b[:]); err != nil { return err } - err = deserializeSigFromWire(e, b) + err = DeserializeSigFromWire(e, b) if err != nil { return err } diff --git a/lnwire/signature.go b/lnwire/signature.go index 45f99631b..344407d4d 100644 --- a/lnwire/signature.go +++ b/lnwire/signature.go @@ -6,9 +6,9 @@ import ( "github.com/roasbeef/btcd/btcec" ) -// serializeSigToWire serializes a *Signature to [64]byte in the format +// SerializeSigToWire serializes a *Signature to [64]byte in the format // specified by the Lightning RFC. -func serializeSigToWire(b *[64]byte, e *btcec.Signature) error { +func SerializeSigToWire(b *[64]byte, e *btcec.Signature) error { // Serialize the signature with all the checks that entails. sig := e.Serialize() @@ -53,9 +53,9 @@ func serializeSigToWire(b *[64]byte, e *btcec.Signature) error { return nil } -// deserializeSigFromWire deserializes a *Signature from [64]byte in the format +// DeserializeSigFromWire deserializes a *Signature from [64]byte in the format // specified by the Lightning RFC. -func deserializeSigFromWire(e **btcec.Signature, b [64]byte) error { +func DeserializeSigFromWire(e **btcec.Signature, b [64]byte) error { // Extract canonically-padded bigint representations from buffer r := extractCanonicalPadding(b[0:32]) diff --git a/lnwire/signature_test.go b/lnwire/signature_test.go index 7a6bb450c..0b5b3775b 100644 --- a/lnwire/signature_test.go +++ b/lnwire/signature_test.go @@ -15,12 +15,12 @@ func TestSignatureSerializeDeserialize(t *testing.T) { // check for errors as well as check if the results are correct. signatureSerializeDeserialize := func(e btcec.Signature) error { var b [64]byte - err := serializeSigToWire(&b, &e) + err := SerializeSigToWire(&b, &e) if err != nil { return err } var e2 *btcec.Signature - err = deserializeSigFromWire(&e2, b) + err = DeserializeSigFromWire(&e2, b) if err != nil { return err }