routing+channeldb: make MPPayment into an interface

This commit turns `MPPayment` into an interface inside `routing`. Having
this interface gives us the benefit to write more granular unit tests
inside payment lifecycle. As seen from the modified unit tests, several
hacky ways of testing the `SendPayment` method is now replaced by a mock
over `MPPayment`.
This commit is contained in:
yyforyongyu authored and Olaoluwa Osuntokun committed 2023-10-06 16:38:33 -07:00
1 parent c412ab5ccb
commit 34d0e5d4c5
8 files changed
+257 -167

No files matched your search

+7
View File
@@ -268,3 +268,10 @@ issues:
# if the returned value doesn't match the type, so there's no need to
# check the convert.
- forcetypeassert
- path: mock*
linters:
# forcetypeassert is skipped for the mock because the test would fail
# if the returned value doesn't match the type, so there's no need to
# check the convert.
- forcetypeassert