From 5cbdb29bcc1206011ad689d9f88933018f127532 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 23 Feb 2018 17:55:07 -0800 Subject: [PATCH] htlcswitch/link_test: mock extracting of error encrypter from onion pkt --- htlcswitch/link_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index 8add4e84..d40eb5f7 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -9,12 +9,11 @@ import ( "testing" "time" - "io" - "math" "github.com/davecgh/go-spew/spew" "github.com/go-errors/errors" + "github.com/lightningnetwork/lightning-onion" "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/contractcourt" @@ -1119,7 +1118,7 @@ func TestChannelLinkMultiHopDecodeError(t *testing.T) { // Replace decode function with another which throws an error. n.carolChannelLink.cfg.DecodeOnionObfuscator = func( - r io.Reader) (ErrorEncrypter, lnwire.FailCode) { + *sphinx.OnionPacket) (ErrorEncrypter, lnwire.FailCode) { return nil, lnwire.CodeInvalidOnionVersion } @@ -1450,7 +1449,7 @@ func newSingleLinkTestHarness(chanAmt, chanReserve btcutil.Amount) ( Peer: alicePeer, Switch: New(Config{}), DecodeHopIterator: decoder.DecodeHopIterator, - DecodeOnionObfuscator: func(io.Reader) (ErrorEncrypter, lnwire.FailCode) { + DecodeOnionObfuscator: func(*sphinx.OnionPacket) (ErrorEncrypter, lnwire.FailCode) { return obfuscator, lnwire.CodeNone }, GetLastChannelUpdate: mockGetChanUpdateMessage,