htlcswitch: expect proper error within TestChannelLinkMultiHopInsufficientPayment

This commit is contained in:
Olaoluwa Osuntokun 2017-10-02 22:24:49 -07:00
parent 0c9384d991
commit 685e09c904
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"runtime" "runtime"
"strings"
"sync" "sync"
"testing" "testing"
"time" "time"
@ -15,7 +16,6 @@ import (
"math" "math"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/go-errors/errors"
"github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/lnwire"
@ -694,8 +694,8 @@ func TestChannelLinkMultiHopInsufficientPayment(t *testing.T) {
n.bobServer.PubKey(), hops, amount, htlcAmt, totalTimelock) n.bobServer.PubKey(), hops, amount, htlcAmt, totalTimelock)
if err == nil { if err == nil {
t.Fatal("error haven't been received") t.Fatal("error haven't been received")
} else if err.Error() != errors.New(lnwire.CodeTemporaryChannelFailure).Error() { } else if !strings.Contains(err.Error(), "insufficient capacity") {
t.Fatalf("wrong error have been received: %v", err) t.Fatalf("wrong error has been received: %v", err)
} }
// Wait for Alice to receive the revocation. // Wait for Alice to receive the revocation.