mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 23:52:35 +02:00
multi: use key locator for lnwallet.MessageSigner
To simplify the message signing API even further, we refactor the lnwallet.MessageSigner interface to use a key locator instead of the public key to identify which key should be signed with.
This commit is contained in:
@@ -19,6 +19,10 @@ import (
|
||||
"github.com/lightningnetwork/lnd/netann"
|
||||
)
|
||||
|
||||
var (
|
||||
testKeyLoc = keychain.KeyLocator{Family: keychain.KeyFamilyNodeKey}
|
||||
)
|
||||
|
||||
// randOutpoint creates a random wire.Outpoint.
|
||||
func randOutpoint(t *testing.T) wire.OutPoint {
|
||||
t.Helper()
|
||||
@@ -310,7 +314,7 @@ func newManagerCfg(t *testing.T, numChannels int,
|
||||
if err != nil {
|
||||
t.Fatalf("unable to generate key pair: %v", err)
|
||||
}
|
||||
privKeySigner := &keychain.PrivKeyMessageSigner{PrivKey: privKey}
|
||||
privKeySigner := keychain.NewPrivKeyMessageSigner(privKey, testKeyLoc)
|
||||
|
||||
graph := newMockGraph(
|
||||
t, numChannels, startEnabled, startEnabled, privKey.PubKey(),
|
||||
@@ -322,6 +326,7 @@ func newManagerCfg(t *testing.T, numChannels int,
|
||||
ChanEnableTimeout: 500 * time.Millisecond,
|
||||
ChanDisableTimeout: time.Second,
|
||||
OurPubKey: privKey.PubKey(),
|
||||
OurKeyLoc: testKeyLoc,
|
||||
MessageSigner: netann.NewNodeSigner(privKeySigner),
|
||||
IsChannelActive: htlcSwitch.HasActiveLink,
|
||||
ApplyChannelUpdate: graph.ApplyChannelUpdate,
|
||||
|
Reference in New Issue
Block a user