htlcswitch/test: stricter error check in TestSwitchSendPayment

This commit is contained in:
Joost Jager 2019-05-06 15:05:14 +02:00
parent 569f821142
commit 55bef96cf3
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -6,7 +6,6 @@ import (
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"strings"
"testing" "testing"
"time" "time"
@ -1825,9 +1824,13 @@ func TestSwitchSendPayment(t *testing.T) {
select { select {
case err := <-errChan: case err := <-errChan:
if !strings.Contains(err.Error(), lnwire.CodeUnknownPaymentHash.String()) { fErr, ok := err.(*ForwardingError)
t.Fatalf("expected %v got %v", err, if !ok {
lnwire.CodeUnknownPaymentHash) t.Fatal("expected ForwardingError")
}
if _, ok := fErr.FailureMessage.(*lnwire.FailUnknownPaymentHash); !ok {
t.Fatalf("expected UnknownPaymentHash got %v", fErr)
} }
case <-time.After(time.Second): case <-time.After(time.Second):
t.Fatal("err wasn't received") t.Fatal("err wasn't received")