htlcswitch/test: stricter error check in TestSwitchSendPayment
This commit is contained in:
parent
569f821142
commit
55bef96cf3
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user