Commit Graph

853 Commits

Author SHA1 Message Date
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
Elle Mouton
25acb51ba3
multi: registration complete MW interceptor msg
In this commit, we change the flow of the rpc middleware registration
a bit. In order to allow a client to add rpc middleware interceptors in
a deterministic order, we now make the server send a "registration
complete" message to the client after compeleting the registration
process so that the client knows when it can go ahead and register the
next client.
2022-07-20 14:58:47 -05:00
Matt Morehouse
7a05f07634
itest: fix sign_psbt failure
Ensure the wallet has synced the blockchain before attempting to spend
funds.

Prior to this fix, I get the following error:
  rpc error: code = Unknown desc = wallet couldn't fund PSBT: error
      creating funding TX: insufficient funds available to construct
      transaction
2022-07-19 12:41:34 -05:00
ErikEk
14453ea7db
itest: cover sign and verify msg 2022-07-14 10:29:29 +02:00
ErikEk
b5af0ce327
signrpc: add schnorr sig to sign and validate msg 2022-07-14 10:29:29 +02:00
Oliver Gugger
9774db614b
itest: add integration test for error interception 2022-07-14 09:36:50 +02:00
Oliver Gugger
e1efb39177
itest: add integration test for request replacement 2022-07-14 09:36:50 +02:00
Oliver Gugger
989648b7ec
itest: fix timeout in sign_psbt test 2022-07-08 16:08:21 +02:00
Oliver Gugger
6980a18ab1
Merge pull request #6712 from Roasbeef/itest-keep-failed-payments
lntest: keep all failed payments by default for HarnessNode
2022-07-08 14:31:37 +02:00
Olaoluwa Osuntokun
2a18263336
lntest: keep all failed payments by default for HarnessNode
In this commit, we fix a detected flake: we go to make a payment, and
then want to assert that 2 attempts we required. The existing logic
assumes that the success and the payment will still be on disk. With a
recent PR, we now delete failed payments by default, but after the fact,
in a non-atomic fashion.

We fix this issue simply by having all the nodes keep around failed
payments for the sake of all the old itests that assumed this
information would always be on disk.

Introduced in: https://github.com/lightningnetwork/lnd/pull/6438.

Fixes https://github.com/lightningnetwork/lnd/issues/6711.
2022-07-07 19:28:30 -07:00
eugene
5e0a2d3f92
itest: zero-conf, scid-alias channel-type integration tests 2022-07-07 17:10:30 -04:00
eugene
49dd4b9e34
multi: add zero-conf, scid-alias channel-types to rpc
This allows the open channel rpcs to use the zero-conf or scid-alias
channel types.
2022-07-07 17:10:30 -04:00
Oliver Gugger
3af42eede9
Merge pull request #6687 from guggero/sign-psbt-np2wkh
walletrpc: Fix SignPsbt for NP2WKH inputs
2022-06-30 12:18:12 +02:00
Oliver Gugger
bb3cec6b12
itest: add test for FundPsbt->SignPsbt|FinalizePsbt flow 2022-06-30 10:27:39 +02:00
Oliver Gugger
9d339f0fe2
Merge pull request #6680 from guggero/compute-input-script
Taproot: Fix p2tr support in `ComputeInputScript`
2022-06-30 10:11:11 +02:00
eugene
a7f5b89cf3
itest: update switch delivery tests with more robust reconnect logic 2022-06-29 13:50:03 -04:00
Oliver Gugger
825ff22eec
itest: add itest for p2tr via ComputeInputScript 2022-06-29 18:29:00 +02:00
Oliver Gugger
6ee4c533f4
itest: fix incorrect naming 2022-06-29 18:29:00 +02:00
Oliver Gugger
21f69192be
itest: rename too specific variables 2022-06-29 18:29:00 +02:00
priyanshiiit
ec9cebea34 lntest: adds check for reserve 2022-06-28 23:31:51 +05:30
priyanshiiit
150c0b5de8 lnwallet: adds RequiredReserve method 2022-06-28 23:31:51 +05:30
priyanshiiit
f6d21d9b1b lntest: adds test for previous outpoints 2022-06-27 16:00:40 +05:30
yyforyongyu
6b34ebbe44
rpcserver: fix wrong unit used in PushAmountSat 2022-05-16 05:49:05 +08:00
Oliver Gugger
70103a1838
multi: return more information in list of leased outputs
With this commit we return the additional information the wallet now
provides about locked/leased outputs.
2022-05-12 10:24:40 +02:00
Oliver Gugger
6c495c1bbe
itest: add Taproot PSBT signing tests 2022-05-11 10:07:51 +02:00
Oliver Gugger
fe30b9e987
itest: refactor PSBT signing itest 2022-05-11 10:07:51 +02:00
Oliver Gugger
d1a151010a
lntest+rpcwallet: support remote p2tr script spend signing 2022-05-11 10:07:51 +02:00
Oliver Gugger
7f4e977073
lntest+rpcwallet: support remote p2tr key spend signing 2022-05-11 10:07:50 +02:00
Olaoluwa Osuntokun
630fc36dcf
multi: introduce and use new TapTweak and SignMethod fields
In this commit, we add a new field `TapTweak` to be used for key path
spends. Before this commit, we'd overload the existing `WitnessScript`
field to pass this information to the signing context. This was
confusing as for tapscript spends, this was the leaf script, which
mirrors the other script based spending types.

With this new filed, users need to set this to the script root for
keypath spends where the output key commits to a real merkle root, and
nothing when bip 86 spending is being used.

To make the signing even more explicit, we also add a new field called
sign_method with an enum type that differentiates between the different
segwit v0 and v1 signing methods.

Fixes https://github.com/lightningnetwork/lnd/issues/6446.
2022-05-11 10:07:49 +02:00
Elle Mouton
e789107e1f
multi: new bitcoind rpcpolling backend for itests 2022-05-11 09:02:13 +02:00
Oliver Gugger
4fd43b4afe
itest: add new funding test with all input types 2022-05-10 20:35:28 +02:00
Oliver Gugger
fd7fe2ae5a
itest: use SendCoinsUnconfirmed in funding test 2022-05-10 18:39:45 +02:00
Oliver Gugger
e27a9fec66
lntest: rename sendCoins to SendCoinsOfType 2022-05-10 18:31:18 +02:00
Oliver Gugger
5d8fba6810
Merge pull request #6502 from bhandras/musig-fix
signer: fix crash in `MuSig2Combine` when the final signature isn't ready
2022-05-06 13:24:27 +02:00
Andras Banki-Horvath
ddf0571031
itest: cover musig2 combine without all signatures ready 2022-05-06 12:29:32 +02:00
Olaoluwa Osuntokun
0ec88b5346
Merge pull request #6347 from yyforyongyu/5388-rm-revc-log
lnwallet+channeldb: store minimal info in revocation log bucket
2022-05-05 15:52:59 -07:00
Oliver Gugger
52e42fc107
lnrpc+itest: implement MuSig2Cleanup RPC 2022-05-04 19:23:58 +02:00
Oliver Gugger
95ff670c0e
multi: add MuSig2Cleanup method to MuSig2 signer 2022-05-04 19:23:58 +02:00
eugene
f7b3da4bb2
htlcswitch+lntest: modify Switch to persist resolution messages
Include unit tests for the Switch, and integration tests that
exercise the persistence logic.
2022-04-29 16:40:19 -04:00
Oliver Gugger
63e93ae572
itest: add taproot SignOutputRaw Bip86 signing test 2022-04-29 11:42:46 +02:00
Oliver Gugger
3ba6421d5c
itest: add MuSig2 end-to-end tests 2022-04-29 11:42:43 +02:00
Oliver Gugger
e31aab5af6
multi: fix inclusion proof size
The inclusion proof field in the TapscriptPartialReveal function was
incorrect. An inclusion proof can be zero or more elements of 32-byte
slices. So an empty inclusion proof can be valid too for a tree that
only consists of a single leaf.
2022-04-29 11:41:09 +02:00