Commit Graph

366 Commits

Author SHA1 Message Date
ccdle12
c46457fb5b
rpcserver+lnd_test: adding check in SendCoins to prevent txs sent to pubkeys 2019-04-20 10:12:20 +08:00
Conner Fromknecht
fd80866627
lnd_test: bump timeout for darwin builds 2019-04-11 16:26:11 -07:00
Conner Fromknecht
5b3170d542 lnd_test: apply AsyncBenchmarkTimeout to async_payments_benchmark
It was mistakenly only applied to async_bidirectional_payments, which
can also see timeouts due to darwin fsync performance regression.
2019-04-11 15:54:21 -07:00
Conner Fromknecht
f19a6a0ba2
lnd_test: use WaitNoError when testing num singles in...
export_channel_backup. Fixes a local flake hit reliably on darwin.
2019-04-10 19:23:08 -07:00
Conner Fromknecht
caa0e2f0b8
Merge pull request #2879 from joostjager/outgoing-go-to-chain
htlcswitch: revert forwarding policy block delta requirements
2019-04-05 15:45:30 -07:00
Olaoluwa Osuntokun
46aa8503b2
Merge pull request #2892 from wpaulino/verify-chan-backup
rpc: modify VerifyChanBackup to take either a Single or Multi
2019-04-05 14:31:37 -07:00
Wilmer Paulino
b71bb9400a
rpc: modify VerifyChanBackup to take either a Single or Multi 2019-04-05 12:51:16 -07:00
Joost Jager
ab4da0f53d
cnct: define separate broadcast delta for outgoing htlcs
This commits exposes the various parameters around going to chain and
accepting htlcs in a clear way.

In addition to this, it reverts those parameters to what they were
before the merge of commit d1076271456bdab1625ea6b52b93ca3e1bd9aed9.
2019-04-05 11:36:07 +02:00
Conner Fromknecht
8f5ddf39ca
lnd_test: use child harness chan backup restore cases
This prevents a panic during test failure due to a child test calling
FailNow on a parent test context. The sub tests now capture the
testing.T object provided in each closure as opposed to ignoring it and
using the parent context.
2019-04-04 02:36:32 -07:00
Olaoluwa Osuntokun
893cff60c4
Merge pull request #2839 from joostjager/htlc-expiry-check
link: increase expiry grace delta for exit hop and forwarded htlcs
2019-04-01 18:15:56 -07:00
Olaoluwa Osuntokun
f2160273b7
test: add new series of itests for various SCB restore scenarios
In this commit, we add 4 new itests for exercising the SCB restore
process via 4 primary scenarios: recover from backup using RPC, recover
from file using RPC, recover channels during init/creation, recover
channels during unlock. With all fields populated there're a total of 24
new scenarios to cover. At the time of authoring of this commit, the
other scenarios (bits are: initiator, updates, private) have been left
out for now, as they increased the run time of the integration tests
significantly.
2019-03-28 17:54:15 -07:00
Olaoluwa Osuntokun
e3029dee45
test: add new itest for exporting SCBs 2019-03-28 17:54:13 -07:00
Olaoluwa Osuntokun
266ddbaceb
test: add new test for streaming SCB updates 2019-03-28 17:54:12 -07:00
Olaoluwa Osuntokun
acc37f7449
test: refactor testDataLossProtection to extract core DLP scenario out to new func
In this commit, we modify the core testDataLossProtection test to
extract the primary DLP assertion logic into a new function. We do this,
as the upcoming SCB tests will fallback to this test after some initial
set up.
2019-03-28 17:54:11 -07:00
Olaoluwa Osuntokun
e3626d1af9
lntest: update to new RestoreNodeWithSeed API 2019-03-28 17:54:09 -07:00
Olaoluwa Osuntokun
ea6ed7b8d2
test: update to new getChanPointFundingTxid
In this commit, we update all uses of the `getChanPointFundingTxid` to
match the new function signature. We no longer need to convert to a
chainhash.Hash, as the method does so underneath now.
2019-03-28 17:54:08 -07:00
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
Joost Jager
cd535b9401
link: increase expiry grace delta
This commit increase the expiry grace delta to a value above the
broadcast delta. This prevents htlcs from being accepted that would
immediately trigger a channel force close.

A correct delta is generated in server.go where there is access to
the broadcast delta and passed via the peer to the links.

Co-authored-by: Jim Posen <jim.posen@gmail.com>
2019-03-26 18:42:00 +01: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