mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-07 03:32:37 +02:00
multi: migrate instances of mockSigner to the mock package
This commit moves all localized instances of mock implementations of the Signer interface to the lntest/mock package. This allows us to remove a lot of code and have it housed under a single interface in many cases.
This commit is contained in:
@@ -6,11 +6,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -19,31 +17,6 @@ var (
|
||||
mockChainHeight = int32(100)
|
||||
)
|
||||
|
||||
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) (input.Signature, error) {
|
||||
|
||||
return &dummySignature{}, nil
|
||||
}
|
||||
|
||||
func (m *mockSigner) ComputeInputScript(tx *wire.MsgTx,
|
||||
signDesc *input.SignDescriptor) (*input.Script, error) {
|
||||
|
||||
return &input.Script{}, nil
|
||||
}
|
||||
|
||||
// MockNotifier simulates the chain notifier for test purposes. This type is
|
||||
// exported because it is used in nursery tests.
|
||||
type MockNotifier struct {
|
||||
|
Reference in New Issue
Block a user