Commit 4442e83
tests: update bolt12_proof_of_payment test for enum pattern
This patch updates the bolt12_proof_of_payment test to use pattern
matching on the new PaidBolt12Invoice enum instead of checking the
kind field and accessing optional invoice fields.
Problem:
The test was using the old struct-based API with .kind field and
.bolt12_invoice.as_ref(), which no longer exists after converting
PaidBolt12Invoice to an enum.
Solution:
Use Rust pattern matching on the PaidBolt12Invoice enum to extract
the invoice directly from the variant, which is more idiomatic and
takes advantage of the type system.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 32ce6bc commit 4442e83
1 file changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
1367 | 1367 | | |
1368 | 1368 | | |
1369 | 1369 | | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1375 | 1379 | | |
1376 | 1380 | | |
1377 | 1381 | | |
| |||
0 commit comments