lnwire: replace usage of btcec.Signature with the new lnwire.Sig type

This commit is contained in:
Olaoluwa Osuntokun
2018-01-30 19:41:52 -08:00
parent 0d7b8be11b
commit 4dd108c827
11 changed files with 31 additions and 60 deletions

View File

@@ -14,16 +14,16 @@ func TestSignatureSerializeDeserialize(t *testing.T) {
// Local-scoped closure to serialize and deserialize a Signature and
// 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)
sig, err := NewSigFromSignature(&e)
if err != nil {
return err
}
var e2 *btcec.Signature
err = DeserializeSigFromWire(&e2, b)
e2, err := sig.ToSignature()
if err != nil {
return err
}
if e.R.Cmp(e2.R) != 0 {
return fmt.Errorf("Pre/post-serialize Rs don't match"+
": %s, %s", e.R, e2.R)