From 3b1db2b186a948b175b50d27075614086fbd3fe8 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 4 Jul 2017 15:52:58 -0700 Subject: [PATCH] test: update integration test set up to reflect recent RPC change A prior commit modified the walletbalance RPC to return satoshi instead of BTC. As a result, we need to update the SetUp method in the networkHarness to ensure we expect the proper value when asserting wallet balances. --- breacharbiter.go | 3 +-- networktest.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/breacharbiter.go b/breacharbiter.go index 1c1995df..6c593598 100644 --- a/breacharbiter.go +++ b/breacharbiter.go @@ -109,8 +109,7 @@ func (b *breachArbiter) Start() error { // For each of the channels read from disk, we'll create a channel // state machine in order to watch for any potential channel closures. - channelsToWatch := make([]*lnwallet.LightningChannel, - len(activeChannels)) + channelsToWatch := make([]*lnwallet.LightningChannel, len(activeChannels)) for i, chanState := range activeChannels { channel, err := lnwallet.NewLightningChannel(nil, b.notifier, b.estimator, chanState) diff --git a/networktest.go b/networktest.go index 72cb823b..e8d7eecf 100644 --- a/networktest.go +++ b/networktest.go @@ -771,7 +771,7 @@ func (n *networkHarness) SetUp() error { } // Now block until both wallets have fully synced up. - expectedBalance := btcutil.Amount(btcutil.SatoshiPerBitcoin * 10).ToBTC() + expectedBalance := int64(btcutil.SatoshiPerBitcoin * 10) balReq := &lnrpc.WalletBalanceRequest{} balanceTicker := time.Tick(time.Millisecond * 50) out: @@ -1347,7 +1347,7 @@ func (n *networkHarness) SendCoins(ctx context.Context, amt btcutil.Amount, return err } - if currentBal.Balance == initialBalance.Balance+amt.ToBTC() { + if currentBal.Balance == initialBalance.Balance+int64(amt) { return nil } case <-time.After(time.Second * 30):