multi: return input.Signature from SignOutputRaw

This commit is contained in:
Conner Fromknecht committed 2020-04-10 14:27:35 -07:00
1 parent 37dffb225a
commit 0f94b8dc62
29 files changed
+168 -110

No files matched your search

@@ -262,7 +262,7 @@ func testJusticeDescriptor(t *testing.T, blobType blob.Type) {
toRemoteSigRaw := toRemoteWitness[0][:len(toRemoteWitness[0])-1]
// Convert the DER to-local sig into a fixed-size signature.
toLocalSig, err := lnwire.NewSigFromRawSignature(toLocalSigRaw)
toLocalSig, err := lnwire.NewSigFromSignature(toLocalSigRaw)
if err != nil {
t.Fatalf("unable to parse to-local signature: %v", err)
}
@@ -310,7 +310,7 @@ func testJusticeDescriptor(t *testing.T, blobType blob.Type) {
// Construct the test's to-local witness.
justiceTxn.TxIn[0].Witness = make([][]byte, 3)
justiceTxn.TxIn[0].Witness[0] = append(toLocalSigRaw,
justiceTxn.TxIn[0].Witness[0] = append(toLocalSigRaw.Serialize(),
byte(txscript.SigHashAll))
justiceTxn.TxIn[0].Witness[1] = []byte{1}
justiceTxn.TxIn[0].Witness[2] = toLocalScript
+2 -2
View File
@@ -30,7 +30,7 @@ func NewMockSigner() *MockSigner {
// in the sign descriptor. The returned signature is the raw DER-encoded
// signature without the signhash flag.
func (s *MockSigner) SignOutputRaw(tx *wire.MsgTx,
signDesc *input.SignDescriptor) ([]byte, error) {
signDesc *input.SignDescriptor) (input.Signature, error) {
s.mu.Lock()
defer s.mu.Unlock()
@@ -50,7 +50,7 @@ func (s *MockSigner) SignOutputRaw(tx *wire.MsgTx,
return nil, err
}
return sig[:len(sig)-1], nil
return btcec.ParseDERSignature(sig[:len(sig)-1], btcec.S256())
}
// ComputeInputScript is not implemented.