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:
eugene committed 2020-08-28 15:43:51 -04:00
1 parent e4764a67cc
commit 49d8f04197
12 files changed
+156 -287

No files matched your search

+4 -3
View File
@@ -29,6 +29,7 @@ import (
"github.com/lightningnetwork/lnd/htlcswitch"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lntest/mock"
"github.com/lightningnetwork/lnd/lntest/wait"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
@@ -1670,7 +1671,7 @@ func createTestArbiter(t *testing.T, contractBreaches chan *ContractBreachEvent,
aliceKeyPriv, _ := btcec.PrivKeyFromBytes(btcec.S256(),
alicesPrivKey)
signer := &mockSigner{key: aliceKeyPriv}
signer := &mock.SingleSigner{Privkey: aliceKeyPriv}
// Assemble our test arbiter.
notifier := makeMockSpendNotifier()
@@ -1897,8 +1898,8 @@ func createInitChannels(revocationWindow int) (*lnwallet.LightningChannel, *lnwa
Packager: channeldb.NewChannelPackager(shortChanID),
}
aliceSigner := &mockSigner{aliceKeyPriv}
bobSigner := &mockSigner{bobKeyPriv}
aliceSigner := &mock.SingleSigner{Privkey: aliceKeyPriv}
bobSigner := &mock.SingleSigner{Privkey: bobKeyPriv}
alicePool := lnwallet.NewSigPool(1, aliceSigner)
channelAlice, err := lnwallet.NewLightningChannel(