Commit Graph

349 Commits

Author SHA1 Message Date
ccdle12
abfbdf6aec rpcserver: check for compatible network in SendCoins
lnd_test: adding address validation for send coins

The commit adds a test that checks that when a user calls sendcoins, the
receiving address is validated according to the current network. If the
address is not compatible with the current network, it will return an
error to the user.

rpcserver: adding a check for compatible network in SendCoins

This commit adds a check in SendCoins that checks whether the receiving
address is compatible with the current network.

Fixes #2677.
2019-03-28 16:42:44 -07:00
Olaoluwa Osuntokun
341f5e4329
Merge pull request #2846 from cfromknecht/lntest-darwin-timeouts
lntest/timeout: split into darwin and non-darwin timeouts
2019-03-28 16:14:38 -07:00
Conner Fromknecht
f3f4093ef0
lntest/timeouts: split into darwin and non-darwin timeouts 2019-03-27 19:00:39 -07:00
Conner Fromknecht
6e61ee2710
lnd_test: use one timeout context per AddInvoice 2019-03-27 19:00:27 -07:00
Olaoluwa Osuntokun
cddbf19aa2
Merge pull request #2759 from Roasbeef/cltv-lower-default
lnd: lower default CLTV delta from 144 to 40
2019-03-27 17:10:08 -07:00
Conner Fromknecht
8baa6d6601
lnd_test: test disable is sent during close 2019-03-12 17:34:42 -07:00
Olaoluwa Osuntokun
c302f1ea3a
lnd: lower default CLTV delta from 144 to 40
In this commit, we lower the default CLTV delta from 144 (1 day) to 40
blocks (~7 hours). We do this as the initial value was purposefully very
high, and was only in place as place holder in earlier versions of the
software. Such a high value can also discourage path finding algorithms
from taking lnd paths due to the negative impact of CLTV value in widely
deployed heuristics.
2019-03-11 18:43:37 -07:00
Olaoluwa Osuntokun
f3215e0a3f
Merge pull request #2610 from halseth/trivial-itest
Small integration test fixes
2019-02-21 16:32:01 -08:00
Joost Jager
d67b1962a8
lnd_test: remove unkeyed field references 2019-02-21 13:47:58 +01:00
Conner Fromknecht
ef41fc6249
lnd_test: set valid chan status config flags 2019-02-14 17:13:21 -08:00
Conner Fromknecht
4686db4196
config+server+lnd_test: expose chan status manager config options
Exposes the three parameters that dictate
the behavior of the channel status manager:
 * --chan-enable-timeout
 * --chan-disable-timeout
 * --chan-status-sample-interval
2019-02-14 17:13:11 -08:00
Olaoluwa Osuntokun
932fafd7cd
lnd_test: extend on chain recovery test to assert utxos 2019-02-11 13:02:00 -08:00
Johan T. Halseth
aefc23938c
lnd_test: assert num channels before state check
Since the getChanInfo call would require the node to have only one
channel, it made no sense to check the number of channels after calling
it.

Instead we check it first, giving the node time to restart.
2019-02-07 15:42:55 +01:00
Johan T. Halseth
b19b26003b
lnd_test: disable mempool check on justice tx rebroadcast
By mistake we were checking that only one transaction was in the mempool
when looking for the justice tx, which wasn't always the case, and would
make the test fail.
2019-02-07 15:41:02 +01:00
Johan T. Halseth
81b2e3502e
lnd_test: convert assertNumOpenChannelsPending to use waitNoError 2019-02-07 15:38:47 +01:00
Johan T. Halseth
3f3656ae4a
lnd_test: assert htlc sweep is mined
To ensure the sweep has properly propagated to the miner and included in
the mined block.
2019-02-07 15:37:49 +01:00
Valentine Wallace
b826101aae lnd_test: alter basic channel creation test to test chan subscription.
Because the integration tests are already long-running, it is preferable to
add testing for the RPC channel update subscription to an existing test rather
than adding additional tests.
2019-02-05 18:18:06 -08:00
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