Commit Graph

11 Commits

Author SHA1 Message Date
Conner Fromknecht
0f94b8dc62
multi: return input.Signature from SignOutputRaw 2020-04-10 14:27:35 -07:00
Conner Fromknecht
37dffb225a
input: introduce Signature iface
This commit introduces the Signature interface which will be used by our
witness construction methods instead of passing in raw byte slices. This
will be used later to inject various kinds of mock signatures, e.g.
73-byte signatures for simulating worst-case witness weight.
2020-04-09 12:49:11 -07:00
Johan T. Halseth
bddd3e128c
lnwallet: make second level sigs using sighash single|anyonecanpay 2020-03-09 12:59:33 +01:00
Johan T. Halseth
50199aeaf3
input/script_utils: add anchor scripts + tests 2020-03-09 12:10:59 +01:00
Johan T. Halseth
990992ce94
input/script_utils: add delayed to_remote script + tests 2020-03-09 12:10:59 +01:00
Johan T. Halseth
a309132253
input/script_utils test: add test cases for delayed HTLC receiver scrpts 2020-03-09 12:10:59 +01:00
Johan T. Halseth
dc271a80cb
input/script_utils test: add test cases for delayed HTLC sender script 2020-03-09 12:10:58 +01:00
Johan T. Halseth
8c0deb81c2
input+lnwallet: Add scripts for CSV delayed HTLC outputs
We also increase the witness size for these types to account for the 3
extra bytes. The size won't be correct in all cases, but it is just an
upper bound in any case.
2020-03-09 12:10:58 +01:00
Johan T. Halseth
b228681a02
input/script_utils_test: refactor TestHTLCSenderSpendValidation
To be able to change more than the witness used for each test case, we
extract commit and sweep tx generation into own methods that can be
called from each test case.

We do the same for TestHTLCReceiverSpendValidation
2020-03-09 12:10:58 +01:00
Johan T. Halseth
b56c7e308b
input/script_utils_test: extract script execution into assert method
This fixes an error case that wouldn't have been caught, since
vm.Execute applies more rules than the individual steps (most notably
the clean stack rule).

Instead we execute the engine as normal, and only step through if we
decide that the outcome is unexpected.
2020-03-09 12:10:58 +01:00
Joost Jager
9e012ecc93
multi: move Input interface and related code
This commit is a step to split the lnwallet package. It puts the Input
interface and implementations in a separate package along with all their
dependencies from lnwallet.
2019-01-31 13:25:33 +01:00