Skip to content

tests: add test_lnwallet to test lnwallet utils#10363

Merged
SomberNight merged 1 commit intospesmilo:masterfrom
f321x:unittest_lnwallet
Jan 12, 2026
Merged

tests: add test_lnwallet to test lnwallet utils#10363
SomberNight merged 1 commit intospesmilo:masterfrom
f321x:unittest_lnwallet

Conversation

@f321x
Copy link
Copy Markdown
Member

@f321x f321x commented Dec 12, 2025

It would be nice to have some way to test the (utility) methods of LNWallet to allow for more coverage and detect regressions like #10350 before they reach the GUI etc.
So i added test_lnwallet.py as a place to test LNWallet things like the creation of PaymentInfo.

@ecdsa
Copy link
Copy Markdown
Member

ecdsa commented Dec 13, 2025

I would very much prefer if we stopped mocking up LNWallet.
For example, we could separate LNWallet from LNWorker.
LNWorker should manage peer-to-peer communications, and be mocked up in unit tests. LNWallet would not be mocked up.

Of course what I am saying is not conflicting with this pull request.
But this PR builds more stuff upon MockLNWallet...

@f321x
Copy link
Copy Markdown
Member Author

f321x commented Dec 15, 2025

LNWorker should manage peer-to-peer communications, and be mocked up in unit tests. LNWallet would not be mocked up.

Ok, then lets do this instead of extending dependency on the mock.

@f321x f321x marked this pull request as draft December 15, 2025 09:49
Adds new unittest file test_lnwallet.py to allow unittesting
utility functions of LNWallet.
@f321x f321x force-pushed the unittest_lnwallet branch from a6cdd93 to 562839c Compare January 8, 2026 12:18
@f321x f321x marked this pull request as ready for review January 8, 2026 12:19
@f321x
Copy link
Copy Markdown
Member Author

f321x commented Jan 8, 2026

This now uses the new LNWallet architecture introduced in #10372

@f321x f321x added the testing 🔎✅ Unit- and Regtests label Jan 8, 2026
Copy link
Copy Markdown
Member

@SomberNight SomberNight left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

@SomberNight SomberNight merged commit 5778fa4 into spesmilo:master Jan 12, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing 🔎✅ Unit- and Regtests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants