mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-19 20:15:18 +02:00
multi: return input.Signature from SignOutputRaw
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
@@ -15,12 +16,22 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
)
|
||||
|
||||
type dummySignature struct{}
|
||||
|
||||
func (s *dummySignature) Serialize() []byte {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
func (s *dummySignature) Verify(_ []byte, _ *btcec.PublicKey) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
type mockSigner struct {
|
||||
}
|
||||
|
||||
func (m *mockSigner) SignOutputRaw(tx *wire.MsgTx,
|
||||
signDesc *input.SignDescriptor) ([]byte, error) {
|
||||
return nil, nil
|
||||
signDesc *input.SignDescriptor) (input.Signature, error) {
|
||||
return &dummySignature{}, nil
|
||||
}
|
||||
|
||||
func (m *mockSigner) ComputeInputScript(tx *wire.MsgTx,
|
||||
@@ -145,8 +156,8 @@ func TestHtlcTimeoutResolver(t *testing.T) {
|
||||
timeout: true,
|
||||
txToBroadcast: func() (*wire.MsgTx, error) {
|
||||
witness, err := input.SenderHtlcSpendTimeout(
|
||||
nil, txscript.SigHashAll, signer,
|
||||
fakeSignDesc, sweepTx,
|
||||
&dummySignature{}, txscript.SigHashAll,
|
||||
signer, fakeSignDesc, sweepTx,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -165,9 +176,9 @@ func TestHtlcTimeoutResolver(t *testing.T) {
|
||||
timeout: false,
|
||||
txToBroadcast: func() (*wire.MsgTx, error) {
|
||||
witness, err := input.ReceiverHtlcSpendRedeem(
|
||||
nil, txscript.SigHashAll,
|
||||
fakePreimageBytes, signer,
|
||||
fakeSignDesc, sweepTx,
|
||||
&dummySignature{}, txscript.SigHashAll,
|
||||
fakePreimageBytes, signer, fakeSignDesc,
|
||||
sweepTx,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user