From 2f2a907b58807c2611f2ad6c8fbf127ebe2138c8 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 30 Apr 2019 18:30:24 -0700 Subject: [PATCH] test: update itest to no longer expect incorrect message for sphinx replay test In this commit, we update the itests to expect the correct message for the sphinx replay test. Before the fixes in the prior commits, we expected the wrong error since we were actually unable to decrypt these converted malformed HTLC errors. Now, we'll properly return a parse able error, so we assert against that error instead of the failure to decode an error. --- lnd_test.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lnd_test.go b/lnd_test.go index 51fe50ed..91f2584c 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -3522,13 +3522,10 @@ func testSphinxReplayPersistence(net *lntest.NetworkHarness, t *harnessTest) { // Construct the response we expect after sending a duplicate packet // that fails due to sphinx replay detection. - replayErr := fmt.Sprintf("unable to route payment to destination: "+ - "TemporaryChannelFailure: unable to de-obfuscate onion failure, "+ - "htlc with hash(%x): unable to retrieve onion failure", - invoiceResp.RHash) - - if resp.PaymentError != replayErr { - t.Fatalf("received payment error: %v", resp.PaymentError) + replayErr := "TemporaryChannelFailure" + if !strings.Contains(resp.PaymentError, replayErr) { + t.Fatalf("received payment error: %v, expected %v", + resp.PaymentError, replayErr) } // Since the payment failed, the balance should still be left