lnwallet: add concrete type for coin selection fail during funding workflow

This commit is contained in:
Olaoluwa Osuntokun committed 2016-09-26 12:18:03 -07:00
1 parent 6c51bc7cee
commit 85b2b52a5f
2 files changed
+17 -9

No files matched your search

+2 -2
View File
@@ -523,7 +523,7 @@ func testFundingTransactionLockedOutputs(miner *rpctest.Harness,
if err == nil {
t.Fatalf("not error returned, should fail on coin selection")
}
if err != lnwallet.ErrInsufficientFunds {
if _, ok := err.(*lnwallet.ErrInsufficientFunds); !ok {
t.Fatalf("error not coinselect error: %v", err)
}
if failedReservation != nil {
@@ -545,7 +545,7 @@ func testFundingCancellationNotEnoughFunds(miner *rpctest.Harness,
// Attempt to create another channel with 44 BTC, this should fail.
_, err = wallet.InitChannelReservation(fundingAmount,
fundingAmount, testHdSeed, numReqConfs, 4)
if err != lnwallet.ErrInsufficientFunds {
if _, ok := err.(*lnwallet.ErrInsufficientFunds); !ok {
t.Fatalf("coin selection succeded should have insufficient funds: %v",
err)
}