-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lnwallet: update Bolt3 test vectors #7439
lnwallet: update Bolt3 test vectors #7439
Conversation
7701631
to
3977c35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK and LGTM! 🚀
3977c35
to
2659659
Compare
Just FYI: the Bolts PR got merged. Can confirm that LDK & Eclair match with these vectors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM🥳 Thanks for taking care of the format fixes!
test := test | ||
for _, test := range testCases { | ||
test := test | ||
name := fmt.Sprintf("%s-%s", set.name, test.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
niiiice
@@ -251,6 +303,18 @@ func addTestHtlcs(t *testing.T, remote, | |||
func testVectors(t *testing.T, chanType channeldb.ChannelType, test testCase) { | |||
tc := newTestContext(t) | |||
|
|||
// Determine which htlc set to use. | |||
testHtlcs := testHtlcsSet1 | |||
if strings.Contains(test.Name, "same amount and preimage") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah - weird I know 🙃 but the spec does actually define this test like this 🙈
In this commit, an assertion is added to the bolt 3 commitment tx tests that ensures that the local and remote balances add up to the expected funding amount. Adding this assertion uncovered a borked test vector which is also fixed in this commit.
Add a new test htlc set comprised of htlc 1 from the original set and two new htlcs, 5 and 6, that use the same preimage and have the same output value (in sats). This htlc set is used in tests that assert the ordering of htlcs that have the same preimage and output value.
2659659
to
05793e5
Compare
This PR updates adds the
option-zero-fee-htlc-tx
test vectors.It also adds the new "same amount and preimage" tests that were missing from the existing legacy and anchor tests.
Fixes #7407