htlcswitch/mock: set SelfKey and mock ErrorSource

This commit is contained in:
Johan T. Halseth 2019-06-07 16:42:25 +02:00
parent 52b7603d25
commit f5dee02ff4
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -163,7 +163,10 @@ func initSwitchWithDB(startingHeight uint32, db *channeldb.DB) (*Switch, error)
} }
} }
priv, _ := btcec.NewPrivateKey(btcec.S256())
pubkey := priv.PubKey()
cfg := Config{ cfg := Config{
SelfKey: pubkey,
DB: db, DB: db,
SwitchPackager: channeldb.NewSwitchPackager(), SwitchPackager: channeldb.NewSwitchPackager(),
FwdingLog: &mockForwardingLog{ FwdingLog: &mockForwardingLog{
@ -390,7 +393,11 @@ func (o *mockDeobfuscator) DecryptError(reason lnwire.OpaqueReason) (*Forwarding
return nil, err return nil, err
} }
priv, _ := btcec.NewPrivateKey(btcec.S256())
pubkey := priv.PubKey()
return &ForwardingError{ return &ForwardingError{
ErrorSource: pubkey,
FailureMessage: failure, FailureMessage: failure,
}, nil }, nil
} }