Skip to content

HTLC test vector update#4493

Merged
rustyrussell merged 5 commits into
ElementsProject:masterfrom
rustyrussell:guilt/htlc-test-vectors
May 3, 2021
Merged

HTLC test vector update#4493
rustyrussell merged 5 commits into
ElementsProject:masterfrom
rustyrussell:guilt/htlc-test-vectors

Conversation

@rustyrussell
Copy link
Copy Markdown
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 <rusty@rustcorp.com.au>
…ACTUAL_FEE`)

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

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…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 <rusty@rustcorp.com.au>
@rustyrussell rustyrussell added this to the v0.10.1 milestone Apr 27, 2021
As from commit 280e9603e9e4fba820aba2c3d27630c1477a7638.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Allow generation of static-remote-key variants of testcases.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell force-pushed the guilt/htlc-test-vectors branch from 7709725 to 3c34e46 Compare April 27, 2021 04:47
Copy link
Copy Markdown
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
Copy Markdown
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