Skip to content

pytest: fix broken test_pay_bolt11_metadata#9178

Open
rustyrussell wants to merge 1 commit into
ElementsProject:masterfrom
rustyrussell:fix-test_pay_bolt11_metadata-fix
Open

pytest: fix broken test_pay_bolt11_metadata#9178
rustyrussell wants to merge 1 commit into
ElementsProject:masterfrom
rustyrussell:fix-test_pay_bolt11_metadata-fix

Conversation

@rustyrussell
Copy link
Copy Markdown
Contributor

It uses a canned, but now expired invoice. Instead, use bolt11-cli to add metadata to an existing invoice.
Changelog-None

It uses a canned, but now expired invoice.  Instead, use bolt11-cli to add metadata to
an existing invoice.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell added this to the v26.06 milestone May 30, 2026
Comment thread tests/test_pay.py
del inv_decoded['signature']
del post_decoded['signature']
del post_decoded['payment_metadata']
assert inv_decoded == post_decoded
Copy link
Copy Markdown
Collaborator

@Lagrang3 Lagrang3 Jun 1, 2026

Choose a reason for hiding this comment

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

This is flaky. The "created_at" field might differ by 1.
It suffices to add a couple of lines

del inv_decoded['created_at']
del post_decoded['created_at']

Comment thread tests/test_pay.py
inv_decoded = l1.rpc.decode(inv['bolt11'])
inv_with_metadata = subprocess.check_output(['devtools/bolt11-cli', 'encode',
# l2's private key (old_hsmsecret, WIF byte stripped)
'0c633a7c17c701a0980158f5483035e01fa8bd091b47fadf2e86e589a9f93fca',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do you get the private key of the regtest nodes?

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