Commit Graph
375 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun c769247198 lntest: allow the main test files to be buildable w/o the rpctest build tag
In this commit, we modify our build tag set up to allow the main test
files to be buildable w/o the current rpctest tag. We do this so that
those of us that use extensions which will compile live files like
vim-go can once again fix compile errors as we go in our editors.

In order to do this, we now make an external `testsCases` variable, and
have two variants: one that's empty (no build tag), and one that's fully
populated with all our tests (build tag active). As a result, the main
file will now always build regardless of if the build tag is active or
not, but we'll only actually execute tests if the `testCases` variable
has been populated.

As sample run w/ the tag off:
```
=== RUN   TestLightningNetworkDaemon
--- PASS: TestLightningNetworkDaemon (0.00s)
PASS
ok  	github.com/lightningnetwork/lnd/lntest/itest	0.051s
```
2020-09-21 21:16:31 +02:00
Olaoluwa Osuntokun acd615aca4 lntest: default to btcd as default test harness backend
Otherwise, if we remove the build tags, then there's no default backend,
and compilation will fail.
2020-09-21 21:16:31 +02:00
Olaoluwa Osuntokun 95634186c2 lntest/itest: move harness to new file
This in prep for a bigger move in the next commit.
2020-09-21 21:16:30 +02:00
Joost Jager 6ae05c6bac Merge pull request #4592 from joostjager/sweep-deadline
cnct+sweep: cpfp-aware anchor sweeping
2020-09-18 20:15:03 +02:00
Joost Jager 29602e88e8 cnct: cpfp-sweep anchors
For unconfirmed commit tx anchors, supply the sweeper with cpfp info and
a confirmation target fee estimate.

The sweeper will try to pay for the parent commit tx as long as the
current fee estimate exceeds the pre-signed commit tx fee rate.
2020-09-17 12:30:41 +02:00
yyforyongyu d2d71476bd lntest: init SignerClient and test DeriveSharedKey 2020-09-17 14:52:36 +08:00
Wilmer Paulino a5c5304c09 Merge pull request #4452 from yyforyongyu/add-connection-timeout
lnrpc+tor: add network connection timeout
2020-09-16 12:28:29 -07:00
Joost Jager 2ebfb64b9b Merge pull request #4606 from joostjager/cpfp-sweep-prep
cnct+sweep+itest: preparations for cpfp-aware sweeper
2020-09-16 11:48:39 +02:00
Joost Jager b6ebf3f27d lntest: use web fee estimator in itests 2020-09-16 08:17:34 +02:00
yyforyongyu e8d9643f3a itest: test for connection timeout 2020-09-16 11:50:59 +08:00
Olaoluwa Osuntokun fa342a1230 Merge pull request #4567 from calvinrzachman/max-wumbo
add new max channel size config option
2020-09-15 15:31:47 -07:00
Oliver Gugger 107e135df9 itest: test PSBT funding flow with raw final TX
As we already create two channels in our PSBT funding flow itest we can
easily just submit the final transaction for the second channel in the
raw wire format to test this new functionality.
2020-09-15 08:30:23 +02:00
Calvin Zachman f5fb64e552 add new max channel size config option
- let users specify their MAXIMUM WUMBO with new config option which sets the maximum channel size lnd will accept
- current implementation is a simple check by the fundingManager rather than anything to do with the ChannelAcceptor
- Add test cases which verify that maximum channel limit is respected for wumbo/non-wumbo channels
- use --maxchansize 0 value to distinguish set/unset config. If user sets max value to 0 it will not do anything as 0 is currently used to indicate to the funding manager that the limit should not be enforced. This seems justifiable since --maxchansize=0 doesn't seem to make sense at first glance.
- add integration test case to ensure that config parsing and valiation is proper. I simplified the funding managers check electing to rely on config.go to correctly parse and set up either i) non wumbo default limit of 0.16 BTC OR ii) wumbo default soft limit of 10 BTC

Addresses: https://github.com/lightningnetwork/lnd/issues/4557
2020-09-14 21:16:32 -05:00
Conner Fromknecht 3c606bd9c0 Merge pull request #4542 from Crypt-iQ/mock_signer_cleanup_0817
multi: remove mock.go
2020-09-11 13:16:17 -04:00
Oliver Gugger 295bd44fea itest: test custom permissions 2020-09-04 09:50:41 +02:00
Oliver Gugger decd2d975c itest: parallelize test steps 2020-09-04 09:50:40 +02:00
Oliver Gugger 9862ee7cd6 itest: extract connection setup 2020-09-04 09:50:40 +02:00
Oliver Gugger 17276e9a7f itest: use only one timeout context
All these operations should be very fast and can be done in just one
timeout context.
2020-09-04 09:50:39 +02:00
Oliver Gugger a929f56781 itest: use require for macaroon tests 2020-09-04 09:50:39 +02:00
Oliver Gugger 906011f278 itest: add _test file name suffix to tests
To fix the compiler of some IDEs complaining about types and functions
it cannot find, we rename all files that contain tests back to lnd_xxx_test.go to make
sure they are compiled correctly.
2020-09-04 09:50:39 +02:00
eugene 9ce89c1b46 lnd: delete mock.go, move mockSpendNotifier to lntest/mock 2020-08-31 20:06:11 -04:00
eugene c7cbacc35b multi: move mockChainIO, mockNotifier to lntest/mock 2020-08-31 19:41:09 -04:00
eugene 3fa5d042c9 multi: move mockWalletController, mockSecretKeyRing to lntest/mock 2020-08-31 18:36:05 -04:00
eugene 49d8f04197 multi: migrate instances of mockSigner to the mock package
This commit moves all localized instances of mock implementations of
the Signer interface to the lntest/mock package. This allows us to
remove a lot of code and have it housed under a single interface in
many cases.
2020-08-28 15:43:51 -04:00
Oliver Gugger 4346a1a3c6 itest: test max pending and abandon channel for shim chans
We change the external funding test to now test two more things: First
that we can open multiple externally funded channels without needing to
lift the default --maxpendingchannels setting. Then we test that we can
use the safer pending_funding_shim_only flag of the AbandonChannel RPC
to get rid of the never confirming external channels.
2020-08-28 12:28:59 +02:00
Oliver Gugger 8ed0efed0b itest: use NoError in external funding tests 2020-08-28 12:28:59 +02:00
Oliver Gugger aa6e3f6d01 itest: extract deriveFundingShim
As a preparation to test accepting multiple externally funded channels
at the same time, we extract the deriveFundingShim function from the
external funding integration test.
2020-08-28 12:28:59 +02:00
Conner Fromknecht a4031f500b rpcserver+fundingmanager: thread remote_max_htlcs to channel opening 2020-08-24 20:11:33 -07:00
Conner Fromknecht 5c91be3f57 config+rpcserver: allow configurable defualt-remote-max-htlcs 2020-08-24 20:11:23 -07:00
Conner Fromknecht 8a22e4fd1c lntest/itest: swap want/got channel constraints
Otherwise the fatal error message incorrectly describes what happpened.
2020-08-24 20:08:19 -07:00
Conner Fromknecht 6c14c73b6b lntest/harness: correct typo in error message 2020-08-24 20:08:19 -07:00
Conner Fromknecht 8390e303c1 lntest/itest: add t.Helper() to assertChannelConstraints 2020-08-24 20:08:15 -07:00
Oliver Gugger c513d0874e itest: fix pattern for short_chan_id in err whitelist 2020-08-24 09:53:41 +02:00
Olaoluwa Osuntokun bd18f9acf5 Merge pull request #4427 from yyforyongyu/customize-root-key-id
macaroons: customize root key ID
2020-08-21 19:34:15 -07:00
Conner Fromknecht fd3f7ca6c8 Merge pull request #4434 from carlaKC/labels-general
multi: add labels to lnd native transactions
2020-08-20 12:58:04 -07:00
yyforyongyu 89c3eb7765 itest: test macaroon creation/deletion 2020-08-14 12:36:21 +08:00
Oliver Gugger 76cd94c277 lntest: make sure restored chans can't be closed 2020-08-12 16:49:39 +02:00
Oliver Gugger 0655a1bcfb itest: move channel backup tests to own file 2020-08-12 16:06:34 +02:00
Conner Fromknecht 37a29b4869 Merge pull request #4496 from cfromknecht/moar-whitelist
lntest/itest: update error whitelist
2020-08-10 12:31:22 -07:00
Conner Fromknecht 0e935eadc0 lntest/itest: add failed getting UTXO error to whitelist 2020-08-07 19:29:35 -07:00
Olaoluwa Osuntokun ef237c549a Merge pull request #4511 from guggero/browser-websocket-fix
Bugfix: Allow browsers to send macaroon in WebSocket calls
2020-08-06 18:24:24 -07:00
Conner Fromknecht df5d334985 lntest/itest: add chain notifier shutting down to whitelist 2020-08-06 12:16:42 -07:00
Conner Fromknecht eb1205d399 lntest/itest: add WS connection reset to error whitelist 2020-08-06 12:16:41 -07:00
Conner Fromknecht 1b660c7387 lntest: add canceled adding new channel to whitelist 2020-08-06 12:16:41 -07:00
Conner Fromknecht de74798c12 lntest/itest: add whitelist entry for block hash fetch 2020-08-06 12:16:41 -07:00
Oliver Gugger af8ffc9764 lntest: add WS test case with custom header macaroon 2020-08-06 12:11:20 +02:00
Oliver Gugger b21b2ebd6f lntest: improve fee calculation in multi-hop test 2020-08-05 09:06:32 +02:00
Oliver Gugger 6115a7b12b make+itest: make itest Windows compatible 2020-08-05 08:53:04 +02:00
carla 2a614cc596 multi: add labels to lnd native transactions
Follow up labelling of external transactions with labels for the
transaction types we create within lnd. Since these labels will live
a life of string matching, a version number and rigid format is added
so that string matching is less painful. We start out with channel ID,
where available, and a transaction "type". External labels, added in a
previous PR, are not updated to this new versioned label because they
are not lnd-initiated transactions. Label matching can check this case,
then check for a version number.
2020-07-29 13:46:07 +02:00
Oliver Gugger ecca1f9653 itest: fix flakiness around/startup/reconnect 2020-07-27 14:15:36 +02:00