Commit Graph

1194 Commits

Author SHA1 Message Date
Oliver Gugger
58d0707a77
itest: test both MuSig2 versions 2023-02-06 10:50:30 +01:00
Oliver Gugger
ce5fa2e043
multi: add version to MuSig2 API, bump btcd/btcec to v2.3.2
With this commit we bump the github.com/btcd/btcec/v2 library to v2.3.2
which implements the MuSig2 BIP version v1.0.0rc2. With this the
github.com/btcsuite/btcd/btcec/v2/schnorr/musig2 package becomes
v1.0.0rc2 and the github.com/lightningnetwork/lnd/internal/musig2v040
stays at the old v0.4.0 version.
2023-02-03 18:30:10 +01:00
Oliver Gugger
ff8f1371b5
itest: add itest for MuSig2 CombineKey
Before we change anything in the MuSig2 API, we first add an integration
test that makes sure the current version of the API combines keys
according to the v0.4.0 test vectors.
2023-02-03 18:25:56 +01:00
Olaoluwa Osuntokun
5d22d5eb6c
Merge pull request #7252 from ellemouton/sqlite-pt2
multi: add sqlite backend option
2023-01-31 10:14:46 -08:00
Oliver Gugger
33a0cbe634
Merge pull request #7292 from Crypt-iQ/disconnectblock_patch
aliasmgr+channeldb: stop deleting zero-conf edges from graph if reorg occurs
2023-01-26 16:26:28 +01:00
eugene
9d56963f5e
itest: add zero-conf reorg edge existence test
This itest asserts that zero-conf edges exist even after a reorg.
Without the prior commit, this test fails.
2023-01-25 12:03:21 -05:00
Chris Geihsler
a5eaabf548
multi: add sqlite option to itests and github job 2023-01-25 14:16:56 +02:00
Olaoluwa Osuntokun
3d8f284af7
lntest/itest: update taproot signing itest to use default and non-default sighashes
Without the prior commit, this test fails with:
```
rpc error: code = Unknown desc = malformed signature: too long: 65 > 64
```
2023-01-24 19:47:34 -08:00
Olaoluwa Osuntokun
8ab598e40c
lntest/itest: make publishTxAndConfirmSweep a test helper
Calling ht.Helper() means we'll get the proper line number if an error
hapens.
2023-01-24 19:47:31 -08:00
ziggie
28bceb23c8
walletrpc: add test sign/verify methods
Test the introduced methods sign/verify messages for single addresses
2023-01-24 09:23:42 +01:00
yyforyongyu
107404dfb8
itest+lntemp: refactor testCustomMessage 2023-01-18 10:53:59 +08:00
yyforyongyu
178e4b0103
lntemp+lntest: fix make lint 2023-01-18 10:53:58 +08:00
yyforyongyu
f3ad66b363
lntest+lntest: inherit node's public states when restarting it
This commit changes how a node's state is created during startup. When
it already has states, only its internal states are reset since these
info are only useful for the finished test. The name `InitRPCClients` is
changed to `Initialize` to reflect the fact that it's more than
initializing RPC clients.
2023-01-18 10:53:58 +08:00
yyforyongyu
0b0c0f12ee
lntemp+lntest: refactor testOpenChannelUpdateFeePolicy 2023-01-18 10:53:58 +08:00
yyforyongyu
1cb7ea1a0c
itest+lntemp: refactor testTrackPayments 2023-01-18 10:53:58 +08:00
yyforyongyu
368b3337bd
itest: refactor testTaprootCoopClose 2023-01-18 10:53:58 +08:00
yyforyongyu
38eaa36d90
lntemp+itest: refactor testRemoteSigner 2023-01-18 10:53:57 +08:00
yyforyongyu
b8566359da
lntemp+itest: refactor testAsyncPayments 2023-01-18 10:53:57 +08:00
yyforyongyu
9000994b7b
lntemp+itest: refactor wallet import tests 2023-01-18 10:53:57 +08:00
yyforyongyu
0176d58b85
itest: refactor testTaproot 2023-01-18 10:53:57 +08:00
yyforyongyu
d78af3cec6
lntemp+itest: refactor testSignPsbt 2023-01-18 10:53:56 +08:00
yyforyongyu
8a04127659
itest: refactor testPsbtChanFunding 2023-01-18 10:53:56 +08:00
yyforyongyu
309ba1fcf4
lntemp+itest: refactor testCPFP 2023-01-18 10:53:56 +08:00
yyforyongyu
08dfebbd6c
lntemp+rpc: refactor testSignVerifyMessage 2023-01-18 10:53:56 +08:00
yyforyongyu
20e454b229
lntemp+itest: refactor testSignOutputRaw 2023-01-18 10:53:56 +08:00
yyforyongyu
ab23421cd8
lntemp+itest: refactor testDeriveSharedKey 2023-01-18 10:53:56 +08:00
yyforyongyu
57e208c176
lntemp+itest: refactor testBasicChannelCreationAndUpdates
We also temporarily comment out the `testRemoteSigner` test and will
bring it back when its sub tests are refacted.
2023-01-18 10:53:55 +08:00
yyforyongyu
2b11a619db
lntemp+itest: refactor testNonstdSweep 2023-01-18 10:53:55 +08:00
yyforyongyu
c4ffd8b469
itest: refactor testOptionScidUpgrade 2023-01-18 10:53:55 +08:00
yyforyongyu
48aa84a08c
itest: refactor testUpdateChannelPolicyScidAlias 2023-01-18 10:53:55 +08:00
yyforyongyu
6b82676ca2
lntemp+itest: refactor testOptionScidAlias 2023-01-18 10:53:55 +08:00
yyforyongyu
15da2a3459
itest: refactor testZeroConfChannelOpen 2023-01-18 10:53:55 +08:00
yyforyongyu
dd7e59237b
itest: refactor testForwardInterceptorBasic 2023-01-18 10:53:54 +08:00
yyforyongyu
97a7638c50
lntemp+itest: refactor testForwardInterceptorDedupHtlc 2023-01-18 10:53:54 +08:00
yyforyongyu
707d888aa4
lntemp+itest: refactor testSendToRouteAMP 2023-01-18 10:53:54 +08:00
yyforyongyu
44b9068de5
itest: refactor testSendPaymentAMP 2023-01-18 10:53:54 +08:00
yyforyongyu
23e45a192e
itest: refactor testSendPaymentAMPInvoiceRepeat 2023-01-18 10:53:54 +08:00
yyforyongyu
780f2e84a3
itest: refactor testSendPaymentAMPInvoice 2023-01-18 10:53:54 +08:00
yyforyongyu
4292c05e04
itest: refactor testSendMultiPathPayment 2023-01-18 10:53:53 +08:00
yyforyongyu
1f1123523e
lntemp+itest: refactor testSendToRouteMultiPath
This commit also introduces `mppTestScenario` which replaces the old
`mppmppTestContext` to reduce the total blocks mined during the test.
For each test case it will save 35 blocks.
2023-01-18 10:53:53 +08:00
yyforyongyu
9943bb8539
itest: refactor testSwitchOfflineDeliveryOutgoingOffline 2023-01-18 10:53:53 +08:00
yyforyongyu
874689719e
itest: refactor testSwitchOfflineDeliveryPersistence 2023-01-18 10:53:53 +08:00
yyforyongyu
476434f546
lntemp+itest: refactor testSwitchOfflineDelivery 2023-01-18 10:53:53 +08:00
yyforyongyu
baeb78e2cc
lntemp+itest: refactor testSwitchCircuitPersistence 2023-01-18 10:53:52 +08:00
yyforyongyu
d4b2798570
itest: make sure SendToRoute stream is recieved with timeout 2023-01-17 07:34:48 +08:00
yyforyongyu
3353643006
itest: fix test testListPayments 2023-01-17 07:26:58 +08:00
yyforyongyu
fe376385d1
lntemp+lntest: fix make lint 2023-01-17 07:26:58 +08:00
yyforyongyu
bc0bdfefc2
itest: refactor testWipeForwardingPackages 2023-01-17 07:26:57 +08:00
yyforyongyu
05f198f34e
itest: refactor testSingleHopInvoice 2023-01-17 07:26:57 +08:00
yyforyongyu
8a4d2741a3
lntemp+itest: refactor testStatelessInit 2023-01-17 07:26:57 +08:00
yyforyongyu
4b469eb0c5
itest: refactor testDeleteMacaroonID 2023-01-17 07:26:57 +08:00
yyforyongyu
64bf6f4e26
itest: refactor testBakeMacaroon 2023-01-17 07:26:57 +08:00
yyforyongyu
9794dbd7b2
itest: refactor testMacaroonAuthentication 2023-01-17 07:26:56 +08:00
yyforyongyu
84278d6a49
lntemp+itest: refactor testRPCMiddlewareInterceptor 2023-01-17 07:26:56 +08:00
yyforyongyu
ad77a45112
lntemp+itest: refactor node restart process
This commit refactors how the node restart is done. It removes the usage
of `HasSeed` and replaces it with `SkipUnlock` for clarity.
2023-01-17 07:26:56 +08:00
yyforyongyu
368635ef95
lntemp+itest: refactor testRouteFeeCutoff 2023-01-17 07:26:56 +08:00
yyforyongyu
b2dc9d8393
lntemp+itest: refactor testQueryRoutes 2023-01-17 07:26:56 +08:00
yyforyongyu
ba6a722ad8
itest: refactor testMultiHopOverPrivateChannels 2023-01-17 07:26:56 +08:00
yyforyongyu
5536f16d4b
itest: refactor testInvoiceRoutingHints 2023-01-17 07:26:56 +08:00
yyforyongyu
2ce93afd70
itest: refactor testPrivateChannels 2023-01-17 07:26:55 +08:00
yyforyongyu
25b6ff3336
itest: refactor testSendToRouteErrorPropagation 2023-01-17 07:26:55 +08:00
yyforyongyu
787883870b
itest: refactor testMultiHopSendToRoute 2023-01-16 16:49:20 +08:00
yyforyongyu
c5785967aa
lntemp+itest: refactor testSingleHopSendToRoute 2023-01-16 16:49:19 +08:00
yyforyongyu
ede86cf08f
itest: send one more UTXO for neutrino backend
Send another UTXO if this is a neutrino backend. When sweeping anchors,
there are two transactions created, `local_sweep_tx` for sweeping
Alice's anchor on the local commitment, `remote_sweep_tx` for sweeping
her anchor on the remote commitment. Whenever the force close
transaction is published, Alice will always create these two
transactions to sweep her anchor.

On the other hand, when creating the sweep txes, the anchor itself is
not able to cover the fee, so another wallet UTXO is needed.  In our
test case, there's a change output that can be used from the above
funding process. And it's used by both sweep txes - when `lnd` happens
to create the `remote_sweep_tx` first, it will receive an error since
its parent tx, the remote commitment, is not known, hence freeing the
change output to be used by `local_sweep_tx`.  For neutrino client,
however, it will consider the transaction which sweeps the remote anchor
as an orphan tx, and it will neither send it to the mempool nor return
an error to free the change output.  Thus, if the change output is
already used in `remote_sweep_tx`, we won't have UTXO to create
`local_sweep_tx`.
2023-01-16 16:49:19 +08:00
yyforyongyu
8df5de3e43
lntest+itest: make sure mempool is cleaned in watcher tower test
This commit adds the missing check for anchor sweep in test
`revoked_uncooperative_close_retribution_altruist_watchtower`, also
change the mempool check a bit so it's easier to track.
2023-01-16 16:49:19 +08:00
yyforyongyu
6792ca17b4
lntemp+itest: refactor testRevokedCloseRetributionAltruistWatchtower 2023-01-16 16:49:19 +08:00
yyforyongyu
211aa4c6f2
itest: refactor testRevokedCloseRetributionRemoteHodl 2023-01-16 16:49:19 +08:00
yyforyongyu
f590a96372
itest: refactor testRevokedCloseRetributionZeroValueRemoteOutput 2023-01-16 16:49:19 +08:00
yyforyongyu
222c06ca48
itest: refactor testRevokedCloseRetribution 2023-01-16 16:49:19 +08:00
yyforyongyu
f254851e01
itest: refactor testRestAPI 2023-01-16 16:49:18 +08:00
yyforyongyu
89727ed1d7
lntemp+itest: refactor testResHandoff 2023-01-16 16:49:18 +08:00
yyforyongyu
83ecc6285c
itest: refactor testPsbtChanFundingSingleStep 2023-01-16 16:49:18 +08:00
yyforyongyu
4a8cf91e53
itest: refactor testPsbtChanFundingExternal 2023-01-16 16:49:18 +08:00
yyforyongyu
68016c0b51
lntemp+itest: refactor testOpenChannelAfterReorg 2023-01-16 16:49:18 +08:00
yyforyongyu
9cb8b120ba
lntemp+itest: refactor testAnchorThirdPartySpend 2023-01-16 16:49:18 +08:00
yyforyongyu
211dad1574
itest: refactor testAnchorReservedValue 2023-01-16 16:49:17 +08:00
yyforyongyu
f1f3d22a81
lntemp+itest: refactor testMultiHopPayments 2023-01-16 16:49:17 +08:00
yyforyongyu
130c4e325a
lntemp+itest: refactor testHtlcErrorPropagation 2023-01-16 16:49:17 +08:00
yyforyongyu
2a7830d442
itest: refactor testMaxHtlcPathfind 2023-01-16 16:49:17 +08:00
yyforyongyu
ec3e1561b6
itest: refactor testWumboChannels 2023-01-16 16:49:17 +08:00
yyforyongyu
638872520e
itest: refactor testMaxChannelSize 2023-01-16 16:49:17 +08:00
yyforyongyu
16bac64ecb
lntemp+itest: refactor testHoldInvoicePersistence 2023-01-16 16:49:17 +08:00
yyforyongyu
984d3ece12
lntemp+itest: refactor testHoldInvoiceForceClose 2023-01-16 16:49:16 +08:00
yyforyongyu
c1b3481354
lntemp+itest: refactor testEtcdFailover 2023-01-16 16:49:16 +08:00
Oliver Gugger
b1645ec46d
Merge pull request #6783 from ErikEk/itest-neutrino-sub-server
itest: neutrino sub-server
2023-01-12 12:20:58 +01:00
ErikEk
20fd630465 itest: test neutrino sub server 2023-01-12 13:43:41 +07:00
ErikEk
cc08271c5f itest: add neutrinoclient to harnessnode 2023-01-12 13:24:44 +07:00
Carla Kirk-Cohen
1b1bc642bc
lntest/itest: add custom messaging itest including new override feature 2023-01-05 12:06:24 -05:00
Olaoluwa Osuntokun
8a18824851
Merge pull request #7243 from guggero/ghost-utxo-fix
wallet: fix ghost UTXOs not being detected
2022-12-13 20:00:31 -08:00
bitromortac
454c115b6e
routing+routerrpc: add capacity in rpcs
FetchPairCapacity is used by the following endpoints to introduce the
capacity for probability calculations:

* QueryProbability
* QueryRoutes
2022-12-12 13:22:29 +01:00
yyforyongyu
289e2db2ee
itest+lntemp: add ChainKitClient RPCs and refactor testChainKit 2022-12-09 23:52:40 +08:00
Oliver Gugger
f26a9a84d7
lntest: fix rescan test to show correct behavior
Now that we have patched the btcwallet version to the one that includes
the fix, we can adjust the rescan test to show the correct and expected
behavior.
2022-12-09 00:56:49 +01:00
Oliver Gugger
2221d0ccb1
lntest+lntemp: add itest case for wallet rescan problem
In this commit we add a test that demonstrates the problem of ghost
UTXOs lingering in the wallet after a re-scan, even if they were spent.

NOTE: This test shows the incorrect behavior and will be adjusted in a
follow-up commit to show the correct behavior after patching the
btcwallet version.
2022-12-09 00:56:49 +01:00
ffranr
1345b3c0aa
itest: add chainkit test
This test covers GetBlock, GetBestBlock, and GetBlockHash.
2022-12-07 14:50:15 +00:00
yyforyongyu
29652d88ee
lntest: add itest for timestamp filters 2022-12-05 20:04:47 +08:00
Olaoluwa Osuntokun
51f131b019
build: update to latest version of btcutil+btcwallet 2022-11-22 13:44:54 +01:00
Oliver Gugger
55b53555e9
multi: improve readability of goroutine defers
This commit fixes the readability of some of the defer calls in
goroutines by making sure the defer stands out properly.
2022-11-21 13:54:24 +01:00
Oliver Gugger
ad8e25cbc9
multi: don't access loop variables in goroutines
This commit makes sure that no loop variables or other temporary
variables are accessed directly in a goroutine but are instead passed
into the goroutine through a parameter. This makes sure a copy of the
value is put on the stack and is not changed while the outside loop
continues.
2022-11-21 13:54:23 +01:00
Oliver Gugger
f1124a0ff9
itest: fix taproot itest timeout issue 2022-11-18 11:10:12 +01:00
yyforyongyu
aafe4c38fc
lntest: fix flake in channel backup related tests
This commit fixes the channel backup tests by decreasing the recovery
window used from 1000 to 100 to speed up the startup of node Dave.
2022-11-17 21:06:13 +08:00
yyforyongyu
3d7aae42b3
lntest: increase node start timeout 2022-11-17 21:06:13 +08:00
yyforyongyu
60da823396
itest: fix make lint 2022-11-17 21:06:12 +08:00
yyforyongyu
966e037d53
itest: refactor testFailingChannel 2022-11-17 21:06:12 +08:00
yyforyongyu
008ef964fc
lntemp+itest: refactor testChannelForceClosure 2022-11-17 21:06:12 +08:00
yyforyongyu
61364c0d9d
lntemp+itest: refactor testCommitmentTransactionDeadline 2022-11-17 21:06:12 +08:00
yyforyongyu
f7f259b92a
itest: refactor testChannelUnsettledBalance 2022-11-17 21:06:11 +08:00
yyforyongyu
8f472bf063
itest: refactor testChannelBalance 2022-11-17 21:06:11 +08:00
yyforyongyu
876bb5c066
itest: refactor testExportChannelBackup 2022-11-17 21:06:11 +08:00
yyforyongyu
40a5f94ef7
lntemp+itest: refactor testChannelBackupUpdates 2022-11-17 21:06:11 +08:00
yyforyongyu
4e821a6e3d
lntemp+itest: refactor testInvoiceSubscriptions 2022-11-17 21:06:11 +08:00
yyforyongyu
d260ac1ab5
itest: refactor testPaymentFollowingChannelOpen 2022-11-17 21:06:11 +08:00
yyforyongyu
e963506f7d
lntemp+itest: refactor testListPayments 2022-11-17 21:06:10 +08:00
yyforyongyu
fc9c6c426e
lntemp+itest: refactor testUpdateNodeAnnouncement 2022-11-17 21:06:10 +08:00
yyforyongyu
c990e053c6
itest: refactor testNodeAnnouncement 2022-11-17 21:06:10 +08:00
yyforyongyu
7029698c16
lntemp+itest: refactor testGraphTopologyNotifications 2022-11-17 21:06:10 +08:00
yyforyongyu
1084e32f0e
itest: refactor testUnannouncedChannels 2022-11-17 21:06:10 +08:00
yyforyongyu
a211e60936
itest: refactor testAddPeerConfig 2022-11-17 21:06:08 +08:00
yyforyongyu
cc1d5f5f8d
lntemp+itest: refactor testReconnectAfterIPChange 2022-11-17 21:05:35 +08:00
yyforyongyu
4c16e053bf
lntemp+itest: refactor testNetworkConnectionTimeout 2022-11-17 21:05:33 +08:00
yyforyongyu
6b943a042c
itest: refactor testUpdateChannelPolicyFeeRateAccuracy 2022-11-17 20:58:06 +08:00
yyforyongyu
cd7f02c866
lntemp+itest: refactor testUpdateChannelPolicyForPrivateChannel 2022-11-17 20:58:06 +08:00
yyforyongyu
b579ed72d9
lntemp+itest: refactor testSendUpdateDisableChannel 2022-11-17 20:58:06 +08:00
yyforyongyu
22f8f83412
multi: refactor testUpdateChannelPolicy 2022-11-17 20:58:05 +08:00
yyforyongyu
1d7c568fcf
lntemp+itest: refactor testBatchChanFunding 2022-11-17 20:29:52 +08:00
yyforyongyu
21097feb85
multi: refactor testFundingPersistence
This commit refactors the test `testFundingPersistence`. In addition, it
also changes the old `OpenChannelAssertPending` method and adds a new
method `OpenChannelAssertStream` for clarity.
2022-11-17 20:29:52 +08:00
yyforyongyu
6a66f3984f
lntemp+itest: refactir testUnconfirmedChannelFunding 2022-11-17 20:29:52 +08:00
yyforyongyu
6a42270ba6
itest: refactor testChannelFundingInputTypes 2022-11-17 20:29:52 +08:00
yyforyongyu
5208c501a2
itest: refactor testOnchainFundRecovery 2022-11-17 20:29:52 +08:00
yyforyongyu
b4d288cc10
lntemp+itest: refactor testGetRecoveryInfo 2022-11-17 20:29:51 +08:00
yyforyongyu
b1b989afae
lntemp+itest: refactor testAbandonChannel 2022-11-17 20:29:51 +08:00
yyforyongyu
2c12c8a77c
multi: refactor testListAddresses 2022-11-17 20:29:51 +08:00
yyforyongyu
4104a72b3a
lntemp+itest: refactor testNodeSignVerify 2022-11-17 20:29:51 +08:00
yyforyongyu
1938e42f4e
itest: refactor testRejectHTLC 2022-11-17 20:29:51 +08:00
yyforyongyu
0c8bce0c1c
itest: refactor testGarbageCollectLinkNodes 2022-11-17 20:29:51 +08:00
yyforyongyu
ba61e9edff
itest+lntemp: refactor testMaxPendingChannels 2022-11-17 20:29:51 +08:00
yyforyongyu
d1ac08b336
itest+lntemp: refactor testListChannels 2022-11-17 20:29:50 +08:00
yyforyongyu
5336c8e5f5
multi: refactor testSphinxReplayPersistence 2022-11-17 20:29:50 +08:00
yyforyongyu
f5ebaa5f35
multi: refactor testDisconnectingTargetPeer 2022-11-17 20:29:50 +08:00
yyforyongyu
d39303f246
itest: wrap assertTxLabel inside wait 2022-11-17 20:29:50 +08:00
yyforyongyu
bbe69f1bd3
multi: refactor testSweepAllCoins 2022-11-17 20:29:50 +08:00
alpeb-btc
0cae501009
lnrpc: provide hop hints when adding an invoice with no amount
With this change we allow adding hop hints when adding an invoice, even
if its amount is zero.

A couple of new unit test case have been added, and the
`testInvoiceRoutingHints` itest was expanded to account for this
scenario.
2022-11-12 05:01:10 -05:00
alpeb-btc
a96483c7d2
itest: refactor testInvoiceRoutingHints' hints check logic
Move code into new closure `checkInvoiceHints` to reuse when checking
other invoices.
2022-11-12 05:01:09 -05:00
Oliver Gugger
b3f6fe315e
itest: add test coverage for Taproot tweak key mutation 2022-11-11 10:20:09 +01:00
Oliver Gugger
e3536dd770
mod+keychain+lntest: bump btcd to version with tweak fix
This commit bumps to the latest version of btcd that fixes a key
mutation issue when signing for Taproot outputs.
2022-11-11 10:20:08 +01:00
yyforyongyu
b7816489a1
itest: add temp fix to bring back btcd build 2022-11-10 13:59:17 +08:00
Joost Jager
511fb00777
htlcswitch: add final htlc event to notifier 2022-10-27 16:42:36 +02:00
Joost Jager
b85cda2a1d
routerrpc: add htlc notifier subscribed event 2022-10-27 16:42:35 +02:00
Slyghtning
8e53996c52 itest: test ForwardingHistory peer lookup opt-in behavior 2022-10-27 07:11:20 -04:00
yyforyongyu
14f45d0722
lntemp+lntest: fix make lint 2022-10-27 01:11:35 +08:00
yyforyongyu
42eab93ba0
lntemp+lntest: use t.Cleanup to register cleanup functions 2022-10-27 01:11:34 +08:00
yyforyongyu
ab62109865
lntemp+lntest: always wait for nodes sync after mining blocks
In this commit, we introduce two mining methods, `MineBlocks` and
`MineBlocksAndAssertNumTxes`, to `HarnessTest`. These methods are
different from the miner's methods as they would 1) mine the blocks
slowly and 2) assert all active nodes have synced. The miner's methods
are kept for future tests such as mining blocks really fast and see the
behavior of `lnd`.
2022-10-27 01:11:34 +08:00
yyforyongyu
f202d27324
itest: break testChannelBackupRestore into smaller tests
This commit breaks the large `testChannelBackupRestore` into smaller
tests to take advantage of our parallel testing framework. A smaller
test also makes the debugging easier, hence better code health.
2022-10-27 01:11:34 +08:00
yyforyongyu
78de9dae05
itest: break testMultiHopHtlcClaims into smaller test cases
This commit breaks the large `testMultiHopHtlcClaims` into independent
test cases to take the advantage of parallel testing. The old setup will
put the stress of creating and syncing new blocks into a single core,
which causes a much longer test time and sometimes times out.
2022-10-27 01:11:34 +08:00
yyforyongyu
3f14ee5870
itest: fix testMultiHopHtlcRemoteChainClaim and linters
This commit makes sure the test `testMultiHopHtlcRemoteChainClaim` takes
account of the one block mined while closing the channel.
2022-10-27 01:11:34 +08:00
yyforyongyu
47279fb9af
itest: fix testMultiHopHtlcLocalChainClaim 2022-10-27 01:11:34 +08:00
yyforyongyu
4668193cfa
itest: fix testMultiHopLocalForceCloseOnChainHtlcTimeout 2022-10-27 01:11:34 +08:00
yyforyongyu
b6cc13417c
itest: move multi hop claim tests into one file 2022-10-27 01:11:33 +08:00
yyforyongyu
c3bc4d403c
itest: reduce blocks mined to save sync time 2022-10-27 01:11:33 +08:00
yyforyongyu
b463147595
itest: refactor testMultiHopHtlcAggregation 2022-10-27 01:11:33 +08:00
yyforyongyu
0115ec8719
itest: refactor testMultiHopHtlcRemoteChainClaim 2022-10-27 01:11:33 +08:00
yyforyongyu
200796b8e2
itest: refactor testMultiHopHtlcLocalChainClaim 2022-10-27 01:11:33 +08:00
yyforyongyu
f65002255c
itest: refactor testMultiHopRemoteForceCloseOnChainHtlcTimeout 2022-10-27 01:11:32 +08:00
yyforyongyu
6b5f4f407c
itest: refactor testMultiHopLocalForceCloseOnChainHtlcTimeout 2022-10-27 01:11:32 +08:00
yyforyongyu
d51f98efc6
itest: refactor testMultiHopReceiverChainClaim 2022-10-27 01:11:32 +08:00
yyforyongyu
5a7c6cea02
lntest+lntemp: refactor testMultiHopHtlcLocalTimeout 2022-10-27 01:11:32 +08:00
yyforyongyu
4a7f45b5d4
itest+lntemp: refactor testMultiHopHtlcClaims 2022-10-27 01:11:32 +08:00
yyforyongyu
e629a3b45a
itest: deprecate createThreeHopNetwork 2022-10-27 01:11:32 +08:00
yyforyongyu
36c84bbd43
itest: refactor testDataLossProtection 2022-10-27 01:11:32 +08:00
yyforyongyu
1fafabe012
itest: move testDataLossProtection to backup test file 2022-10-27 01:11:31 +08:00
yyforyongyu
8cd5a9b6b1
itest: refactor testChannelBackupRestore 2022-10-27 01:11:31 +08:00
yyforyongyu
2966773018
lntemp: add more assertions and supporting methods 2022-10-27 01:11:31 +08:00
yyforyongyu
1b741cb6cc
itest: refactor testExternalFundingChanPoint 2022-10-27 01:11:30 +08:00
yyforyongyu
773cc8e295
itest: refactor testBasicChannelFunding
The test `testExternalFundingChanPoint` is commented out and will be put
back in the following commit.
2022-10-27 01:11:30 +08:00
yyforyongyu
85210b947f
itest: deprecate deriveFundingShim 2022-10-27 01:11:30 +08:00
Slyghtning
85f0ec2954 itest: check peer alias in ForwardingHistory 2022-10-20 09:23:50 -04:00
yyforyongyu
353b744039
lntemp+itest: create interface WebFeeService
This commit adds a new interface, `WebFeeService`, so external projects
can create their own mocked fee services.
2022-10-14 15:45:25 +08:00
yyforyongyu
9d79e76876
itest: timeout while waiting for predicate result
This commit sends the returned value of pred() inside a goroutine such
that when a predicate function never returns during the first run, the
wait package can timeout properly.
2022-10-14 15:45:24 +08:00
yyforyongyu
2ab842c645
itest: refactor test testUpdateChanStatus 2022-10-14 15:45:24 +08:00
yyforyongyu
1350f76627
itest: add a new test entry point to run the temp tests
This commit adds a new function, `TestLightningNetworkDaemonTemp`, to
run the new tests.
2022-10-14 15:45:24 +08:00
yyforyongyu
cd5ab844e2
lntest: export flag logoutput
This commit temporarily exports the flag `logoutput` so it can be used
by `lntemp`.
2022-10-14 07:25:29 +08:00
yyforyongyu
55f8a621ae
lntest+github: add flag temptest to run tests separately
This commit adds a new flag `temptest` so we can run new and old tests
separately. This flag will be removed once the migration from old tests
to new tests is finished.
2022-10-14 07:25:28 +08:00
Olaoluwa Osuntokun
2482de9cab
lnwallet/chancloser: properly compute initial fee of cop close txn
In this commit, we modify the way we compute the starting ideal fee for
the co-op close transaction. Before thsi commit, channel.CalcFee was
used, which'll compute the fee based on the commitment transaction
itself, rathern than the co-op close transaction. As the co-op close
transaction is potentailly bigger (two P2TR outputs) than the commitment
transaction, this can cause us to under estimate the fee, which can
result in the fee rate being too low to propagate.

To remedy this, we now compute a fee estimate from scratch, based on the
delivery fees of the two parties.

We also add a bug fix in the chancloser unit tests that wasn't caught
due to loop variable shadowing.

The wallet import itest has been updated as well, since we'll now pay
600 extra saothis to close the channel, since we're accounting for the
added weight of the P2TR outputs.

Fixes #6953
2022-10-10 14:50:45 -07:00
Slyghtning
41822a8baf itest: openchannel fee scenarios 2022-09-29 08:31:47 -04:00
Olaoluwa Osuntokun
d062a5263e
build: update to latest version of btcwallet w/ taproot estimation fix
Fixes https://github.com/lightningnetwork/lnd/issues/6873
2022-09-27 11:24:39 -07:00
Jesse de Wit
4bc3007668
lntest: add trackpayments itest
Add an itest for the new TrackPayments api.
2022-09-08 10:48:34 +02:00
Oliver Gugger
c45d0f6b07
itest: add integration tests for tapscript import
We add basic integration test coverage for importing Tapscript
addresses. Note that FundPsbt is not supported with those types of
imported keys, so we need to manually fill in all information in the
PSBT to be able to sweep the funds again.
2022-08-25 09:21:52 +02:00
Oliver Gugger
0d6e791042
lntest+lnwallet: add ImportTaprootScript to wallet interface 2022-08-25 09:20:23 +02:00
Oliver Gugger
3a66a09d9d
itest: test BIP-0086 Taproot account+pubkey import 2022-08-25 09:20:23 +02:00
Eng Zer Jun
ca5c695526
lntest/itest: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-24 09:03:04 +08:00
yyforyongyu
0735522194
multi: fix make fmt 2022-08-23 22:10:24 +08:00
priyanshiiit
3105d6a2ec lntest: adds test for list addresses 2022-08-18 08:09:16 +05:30
priyanshiiit
99e4728eb7 lnwallet: adds list addresses method 2022-08-18 07:58:24 +05:30
Slyghtning
b2e624cd52 psbt: Indicate which psbt inputs were signed 2022-08-16 19:31:06 -04:00
eugene
48912560e2
lntest: update zero-conf tests to account for zeroconfacceptor 2022-08-12 16:36:17 -04:00
Olaoluwa Osuntokun
3bf2790e21
lntest/itest: add new itest to cover taproot co-op close 2022-08-10 18:44:39 -07:00
Oliver Gugger
17014b592e
Merge pull request #6730 from Roasbeef/notifier-optional-block
chainntfns: add new option for conf notifications to send block
2022-08-10 13:52:49 +02:00
eugene
6ec2826f6c
sweep: account for all script types in craftSweepTx
With this change, transactions created via craftSweepTx will be
standard. Previously, p2wsh/p2pkh scripts passed in via SendCoins would
be weighted as p2wpkh scripts. With a feerate of 1 sat/vbyte,
transactions returned would be non-standard. Luckily, the critical
sweeper subsystem only used p2wpkh scripts so this only affected
callers from the rpcserver.

Also added is an integration test that fails if SendCoins manages
to generate a non-standard transaction. All script types are now
accounted for in getWeightEstimate, which now errors if an unknown
script type is passed in.
2022-08-08 15:33:00 -04:00
Olaoluwa Osuntokun
89dc75cd90
lntest/itest: add test case for conf ntfn w/ block
In this commit, we add a test case to exercise the fact that if we
request a confirmation notification with the raw block, then it includes
one. We add this to the existing test that uses the conf ntfn rpc call
for simplicity.
2022-08-01 19:59:33 -07:00
Olaoluwa Osuntokun
08f1c2e93a
chainntfns: add new option for conf notifications to send block
In this commit, we add a new option for the existing confirmation
notification system that optionally allows the caller to specify that a
block should be included as well.

The only quirk w/ the implementation here is the neutrino backend:
usually we get filtered blocks, we so need to first fetch the block
again so we can deliver the full block to the notifier. On the notifier
end, it'll only be checking for the transactions we care about, to
sending a full block doesn't affect the correctness.

We also extend the `testBatchConfirmationNotification` test to assert
that a block is only included if the caller specifies it.
2022-08-01 19:59:21 -07:00
Olaoluwa Osuntokun
fec8fd9c63
Merge pull request #6754 from ellemouton/ensureRpcRegistrationOrder
multi: synchronous rpc middleware registration
2022-07-26 19:05:30 -05:00