diff --git a/lnwallet/signdescriptor.go b/lnwallet/signdescriptor.go index 08c24e5d2..56eca39dd 100644 --- a/lnwallet/signdescriptor.go +++ b/lnwallet/signdescriptor.go @@ -5,7 +5,6 @@ import ( "errors" "io" - "github.com/lightningnetwork/lnd/lnwire" "github.com/roasbeef/btcd/btcec" "github.com/roasbeef/btcd/txscript" "github.com/roasbeef/btcd/wire" @@ -104,7 +103,7 @@ func WriteSignDescriptor(w io.Writer, sd *SignDescriptor) error { return err } - if err := lnwire.WriteTxOut(w, sd.Output); err != nil { + if err := writeTxOut(w, sd.Output); err != nil { return err } @@ -174,7 +173,7 @@ func ReadSignDescriptor(r io.Reader, sd *SignDescriptor) error { sd.WitnessScript = witnessScript txOut := &wire.TxOut{} - if err := lnwire.ReadTxOut(r, txOut); err != nil { + if err := readTxOut(r, txOut); err != nil { return err } sd.Output = txOut diff --git a/lnwire/txout.go b/lnwallet/txout.go similarity index 72% rename from lnwire/txout.go rename to lnwallet/txout.go index f75f51a84..22d1b9d74 100644 --- a/lnwire/txout.go +++ b/lnwallet/txout.go @@ -1,4 +1,4 @@ -package lnwire +package lnwallet import ( "encoding/binary" @@ -7,8 +7,8 @@ import ( "github.com/roasbeef/btcd/wire" ) -// WriteTxOut serializes a wire.TxOut struct into the passed io.Writer stream. -func WriteTxOut(w io.Writer, txo *wire.TxOut) error { +// writeTxOut serializes a wire.TxOut struct into the passed io.Writer stream. +func writeTxOut(w io.Writer, txo *wire.TxOut) error { var scratch [8]byte binary.BigEndian.PutUint64(scratch[:], uint64(txo.Value)) @@ -23,8 +23,8 @@ func WriteTxOut(w io.Writer, txo *wire.TxOut) error { return nil } -// ReadTxOut deserializes a wire.TxOut struct from the passed io.Reader stream. -func ReadTxOut(r io.Reader, txo *wire.TxOut) error { +// readTxOut deserializes a wire.TxOut struct from the passed io.Reader stream. +func readTxOut(r io.Reader, txo *wire.TxOut) error { var scratch [8]byte if _, err := io.ReadFull(r, scratch[:]); err != nil { diff --git a/lnwire/txout_test.go b/lnwallet/txout_test.go similarity index 89% rename from lnwire/txout_test.go rename to lnwallet/txout_test.go index 4fcd9d135..d697de78d 100644 --- a/lnwire/txout_test.go +++ b/lnwallet/txout_test.go @@ -1,4 +1,4 @@ -package lnwire +package lnwallet import ( "bytes" @@ -28,12 +28,12 @@ func TestTxOutSerialization(t *testing.T) { var buf bytes.Buffer - if err := WriteTxOut(&buf, &txo); err != nil { + if err := writeTxOut(&buf, &txo); err != nil { t.Fatalf("unable to serialize txout: %v", err) } var deserializedTxo wire.TxOut - if err := ReadTxOut(&buf, &deserializedTxo); err != nil { + if err := readTxOut(&buf, &deserializedTxo); err != nil { t.Fatalf("unable to deserialize txout: %v", err) }