Skip to content
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

HTLC test vector update #4493

Merged

Conversation

rustyrussell
Copy link
Contributor

@rustyrussell rustyrussell commented Apr 27, 2021

This implements generation of test vectors to replicate lightning/bolts#539 (merged) and does it in the cleaned-up format proposed in lightning/bolts#852. (When that is merged, we'll need to update some internal bolt quotes, but they're easy).

Changelog-None

Allows us to precisely replicate test vectors.

Signed-off-by: Rusty Russell <[email protected]>
…ACTUAL_FEE`)

Has an out-by-one error, but only used for test-vector generation.

Signed-off-by: Rusty Russell <[email protected]>
…sely

Still needs some massaging (we print HTLCs as we add them, rather then
in the final order, which requires a manual move in one test vector),
but this makes it more trivial to compare the output with the BOLT 3
text after lightning/bolts#852

Signed-off-by: Rusty Russell <[email protected]>
@rustyrussell rustyrussell added this to the v0.10.1 milestone Apr 27, 2021
As from commit 280e9603e9e4fba820aba2c3d27630c1477a7638.

Signed-off-by: Rusty Russell <[email protected]>
Allow generation of static-remote-key variants of testcases.

Signed-off-by: Rusty Russell <[email protected]>
@rustyrussell rustyrussell force-pushed the guilt/htlc-test-vectors branch from 7709725 to 3c34e46 Compare April 27, 2021 04:47
Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3c34e46

Comment on lines +901 to +909
/* Spec was "neatened" to change these numbers to words! */
tx->wtx->num_outputs == 7 ? "seven outputs"
: tx->wtx->num_outputs == 6 ? "six outputs"
: tx->wtx->num_outputs == 5 ? "five outputs"
: tx->wtx->num_outputs == 4 ? "four outputs"
: tx->wtx->num_outputs == 3 ? "three outputs"
: tx->wtx->num_outputs == 2 ? "two outputs"
: tx->wtx->num_outputs == 1 ? "one output"
: "no outputs???",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh 😤

@rustyrussell rustyrussell merged commit 7bc78c4 into ElementsProject:master May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants