Commit Graph

332 Commits

Author SHA1 Message Date
Joost Jager
55aee9c703
cnct: expose non-incubating htlcs after channel force close
In this commit we fix a reporting gap that previously existed for htlcs
that were still contested.
2019-02-01 09:36:47 +01:00
Conner Fromknecht
9d20ca4a51
Merge pull request #2495 from halseth/itest-dont-shadow-prederr
[trivial] lnd_test: don't shadow predErr
2019-01-31 18:26:11 -08:00
Olaoluwa Osuntokun
b1b42dcfae
test: update error propagation test for new onion error change
In this commit, we update the error propagation test to ensure that the
proper HTLC amount is included for the `CodeUnknownPaymentHash` error.
2019-01-29 23:03:42 -08:00
Wilmer Paulino
016add6adc
lnd_test: extend chain claim test with invoice settled check
In this commit, we extend the remote/receiver chain claim integration
test to assert that the on-disk representation of the invoice on the
receiving side (Carol) is marked as settled due to the claiming the HTLC
on-chain.
2019-01-22 20:46:14 -08:00
Johan T. Halseth
33b2d92b80
lnd_test: don't shadow predErr
Would lead to the printed predErr not being set. We instead use the new
WaitNoError method to avoid this.
2019-01-22 13:41:51 +01:00
Johan T. Halseth
2b16fb7271
lnd_test: fix reorg test by using new Node RPC
Since the chain backend and miner is now seperate nodes, the reorg test
must be slightly rewritten. We use the Btcd Node RPC to connect and
disconnect the three bitcoin nodes in question (chain backend, miner,
temp miner) to control the reorg scenario.
2019-01-16 10:10:22 +01:00
Johan T. Halseth
92b984a233
lnd_test+lntest: seperate miner and chain backend
Since we are no longer passing in the miner as the chain backend, we
don't have to export the fields.
2019-01-16 10:10:22 +01:00
Johan T. Halseth
989fe50da8
lntest: define BackendCfg and btcd impl
BackendCfg is an interface that can be backed by different Bitcoin node
implementations. We currently use the btcdHarness as our chain backend.
2019-01-16 09:44:29 +01:00
Olaoluwa Osuntokun
509bed614c
Merge pull request #2198 from Roasbeef/sendall-rpc
multi: add ability to sweep all coins in the the wallet to an addr to sendcoins
2019-01-15 14:49:17 -08:00
ccdle12
264293ff89 rpcserver+lnd_test: adding PendingHtlcs to UnsetteldBalance
rpcserver: summing PendingHtlcs and assigning to UnsettledBalance

lnd_test: adding tests for UnsettledBalance
2019-01-10 22:11:38 -05:00
Olaoluwa Osuntokun
e140cbb945
test: add integration test for sweeping all coins from wallet 2019-01-09 15:55:31 -08:00
Joost Jager
9e611636ee
lnrpc: update github.com/golang/protobuf to v1.2.0
Update is necessary to get protoc to generate files in the right
directory when using modules outside the gopath. The old version of this
dependency did not support paths=source_relative.

This commit also fixes a build error in lnd_test.go because of a
slight difference in generated code.
2018-12-18 14:57:24 +01:00
Johan T. Halseth
3be292b36e
lnd_test: use context with timeout instead of context.Background
To ensure RPC calls won't block indefinitely.
2018-12-13 08:34:57 +01:00
Johan T. Halseth
f989b2ece8
lnd_test: let assertNumConnections set its own context 2018-12-13 08:33:13 +01:00
Johan T. Halseth
6a4edc8335
lnd_test: let assertNodeNumChannels set its own context 2018-12-13 08:33:12 +01:00
Johan T. Halseth
4db939069a
lnd_test: use cancelable context for SendPayment 2018-12-13 08:31:58 +01:00
Johan T. Halseth
fd347888bb
lnd_test: make assertAmountPaid set its own context timeout
Let us avoid having to set it each time we call it.
2018-12-13 08:31:58 +01:00
Olaoluwa Osuntokun
8c5d6842c2
Merge pull request #2117 from halseth/integration-tests-backend-logs
Save integration tests backend logs
2018-12-12 16:07:25 -08:00
Olaoluwa Osuntokun
56a74e7cfd
Merge pull request #2156 from halseth/integration-tests-wait-before-mining
[Integration tests]: make sure miner have seen tx before mining
2018-12-12 15:57:50 -08:00
AdamISZ
9bb2a26948
Add listunspent RPC call
Returns a brief json summary of each utxo found by calling
ListUnspentWitness in the wallet. The two arguments are the
minimum and maximum number of conrfirmations (0=include
unconfirmed)
2018-12-11 15:26:38 +01:00
Johan T. Halseth
bea31310e1
lnd_test: make sure miner have seen tx before mining
This commit makes mineBlocks take an argument to check the number of txs
expected in the mempool before mining. By using waitForTxInMempool
before mining blocks we ensure that the txs in question have actually
propagated to the miner's mempool before mining the blocks.
2018-11-29 12:33:16 +01:00
Johan T. Halseth
cdcb7105b3
lnd_test: assert existence of unconfirmed tx in mempool 2018-11-29 12:31:40 +01:00
Johan T. Halseth
b07499f227
Merge pull request #2224 from halseth/itest-timeouts
lnd_test: increase test timeouts
2018-11-28 08:22:46 +01:00
Johan T. Halseth
4d05e6bbd8
lnd_test+lntest: keep btcd debug logs from test run
Useful for debugging 🤷
2018-11-27 10:21:19 +01:00
Johan T. Halseth
3a2fd51f2f
lnd_test+lntest: move copyFile() -> lntest.CopyFile() 2018-11-27 10:21:17 +01:00
Johan T. Halseth
ec76a25530
lnd_test: make test use globale defaultCSV 2018-11-27 10:11:32 +01:00
Johan T. Halseth
62e37ec840
lnd_test: use global defaultTimeout instead of test specific timeouts 2018-11-27 10:01:02 +01:00
Johan T. Halseth
f13e5472d5
lnd_test: use global minerMempoolTimeout when waiting for miner to see TXs 2018-11-27 09:59:46 +01:00
Johan T. Halseth
ea32a13fdb
lnd_test: use global channelCloseTimeout when closing channels 2018-11-27 09:59:31 +01:00
Johan T. Halseth
864d77d82e
lnd_test: use global channelOpenTimeout when opening channels 2018-11-27 09:59:29 +01:00
Johan T. Halseth
0c4948b40b
lnd test: add offline scenario to testDataLossProtection
This adds the scenario where a channel is closed while the node is
offline, the node loses state and comes back online. In this case the
node should attempt to resync the channel, and the peer should resend a
channel sync message for the closed channel, such that the node can
retrieve its funds.
2018-11-21 10:28:57 +01:00
Johan T. Halseth
13098a595a
lnd test: refactor testDataLossProtection
This extracts part of the test into a new helper method timeTravel,
which can be used to easily reset a node back to a state where channel
state is lost.
2018-11-21 10:12:04 +01:00
Johan T. Halseth
0ca7c8c5f8
lnd_test: define helper getChanInfo 2018-11-21 10:12:04 +01:00
Johan T. Halseth
eb2f832bba
lnd_test: define createPayReqs helper method 2018-11-21 10:12:04 +01:00
Johan T. Halseth
e1d8b07735
lnd_test: remove unused math/rand rependency 2018-11-21 10:07:56 +01:00
Johan T. Halseth
d7cbdea9db
lnd_test: add waitForChannelPendingForceClose
This commit introduces a new utility method
waitForChannelPendingForceClose, that is used to ensure a force closed
channel has been recognized by the UTXO nursery, and is ready to be
swept as soon as it matures.

The commit also utilizes this method to properly wait before mining
blocks in certain tests, as it makes sure that the UTXO nursery will
react properly to the new blocks.
2018-11-09 08:50:00 +01:00
Johan T. Halseth
1516ceb37a
Merge pull request #2160 from halseth/integration-tests-mine-reorged-funding-tx
[Integration tests] mine reorged funding tx
2018-11-09 08:48:09 +01:00
Johan T. Halseth
1208c66a89
lnd_test: mine reorged out funding tx 2018-11-06 10:35:05 +01:00
Johan T. Halseth
6d91d816a9
lnd_test: remove log disabling hack 2018-11-06 10:27:47 +01:00
Johan T. Halseth
3bb9b398e5
lnd_test: define global test timeouts
In preparation for the added propagation delay by separating the miner
and the chain backend, we increase several timeouts throughout the test,
and extract them into constants that can easily be altered.
2018-11-05 22:16:32 +01:00
Conner Fromknecht
da56aa3528
lnd_test: process all node/edge updates in graph_top_itest
This commit modifies the graph topology test to
properly count channel updates and node
announcments in the event that they are batched
into a single topology update. The prior logic
made the assumption that they were always in
distinct topology updates, so this method should
be more general and robust.
2018-10-24 19:20:01 -07:00
Wilmer Paulino
6686ae3001
lnd_test: update testInvoiceRoutingHints to account
In this commit, we open an additional channel between Bob and Carol to
ensure that Bob gets selected as the only routing hint. Previously Bob
would get selected, but with the recent changes, it would no longer
happen due to him not having any advertised edges.
2018-10-24 19:20:01 -07:00
Wilmer Paulino
7166130037
lnd_test: add onion addresses to testNodeAnnouncement
In this commit, we include onion addresses in testNodeAnnouncement to
ensure they properly propagate throughout the network.
2018-10-23 18:42:33 -07:00
bluetegu
d942bb58c3 Add support for IncludeUnannounced property of ChannelGraphRequest in
DescribeGraph rpc server method.
2018-10-04 14:54:35 -04:00
Olaoluwa Osuntokun
6afee3d099
Merge pull request #1856 from maurycy/typos
multi: fix various typos in comments
2018-09-27 20:38:10 -07:00
Joost Jager
a75b0c871b
lnd_test: add AbandonChannel test 2018-09-20 18:33:47 -07:00
Johan T. Halseth
598904fbb9
lnd_test: restart nodes twice to trigger pruning logic 2018-09-11 10:25:48 +02:00
Johan T. Halseth
a926665358
lnd_test: make sure we stay disconnected using WaitInvariant in testGarbageCollectLinkNodes 2018-09-11 10:25:48 +02:00
maurycy
ac24b12bf2
multi: fix various typos in comments 2018-09-07 06:51:49 +02:00
Olaoluwa Osuntokun
555b7db602
test: fix flake in link node garbage collection test
In this commit, we fix a flake in the link node garbage collection test
by ensuring the channels have been fully closed on both sides before we
attempt to restart and ensure that they don't actually establish
connections. Without this check, it's possible that either side hasn't
yet processed all the blocks, so they'll still reconnect to each other on
start up.
2018-09-06 16:57:32 -07:00