From f5dee02ff445e74d3682b3f0aab5c67ff3aec66d Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Fri, 7 Jun 2019 16:42:25 +0200 Subject: [PATCH] htlcswitch/mock: set SelfKey and mock ErrorSource --- htlcswitch/mock.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htlcswitch/mock.go b/htlcswitch/mock.go index be9c3994..df059914 100644 --- a/htlcswitch/mock.go +++ b/htlcswitch/mock.go @@ -163,7 +163,10 @@ func initSwitchWithDB(startingHeight uint32, db *channeldb.DB) (*Switch, error) } } + priv, _ := btcec.NewPrivateKey(btcec.S256()) + pubkey := priv.PubKey() cfg := Config{ + SelfKey: pubkey, DB: db, SwitchPackager: channeldb.NewSwitchPackager(), FwdingLog: &mockForwardingLog{ @@ -390,7 +393,11 @@ func (o *mockDeobfuscator) DecryptError(reason lnwire.OpaqueReason) (*Forwarding return nil, err } + priv, _ := btcec.NewPrivateKey(btcec.S256()) + pubkey := priv.PubKey() + return &ForwardingError{ + ErrorSource: pubkey, FailureMessage: failure, }, nil }