lnwallet: update interface tests to account for recent lnwire.MilliSatoshi change

lnwire.MilliSatoshi is now a signed integer, as a result, we’ll return
a different error if our balances go to negative due to the inability
to pay a the set fee.
This commit is contained in:
Olaoluwa Osuntokun committed 2018-03-08 12:50:48 -05:00
1 parent 8425a35684
commit 19bc477b9a
1 file changed
+6 -4
+6 -4
View File
@@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/keychain" "github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/lnwire"
@@ -806,8 +807,9 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
dustLimit: tc.dustLimit, dustLimit: tc.dustLimit,
isOurs: true, isOurs: true,
} }
err = channel.createCommitmentTx(commitmentView, theHTLCView, err = channel.createCommitmentTx(
keys) commitmentView, theHTLCView, keys,
)
if err != nil { if err != nil {
t.Errorf("Case %d: Failed to create new commitment tx: %v", i, err) t.Errorf("Case %d: Failed to create new commitment tx: %v", i, err)
continue continue
@@ -836,8 +838,8 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
// Check that commitment transaction was created correctly. // Check that commitment transaction was created correctly.
if commitTx.WitnessHash() != *expectedCommitmentTx.WitnessHash() { if commitTx.WitnessHash() != *expectedCommitmentTx.WitnessHash() {
t.Errorf("Case %d: Generated unexpected commitment tx: "+ t.Errorf("Case %d: Generated unexpected commitment tx: "+
"expected %s, got %s", i, expectedCommitmentTx.WitnessHash(), "expected %s, got %s", i, spew.Sdump(expectedCommitmentTx),
commitTx.WitnessHash()) spew.Sdump(commitTx))
continue continue
} }