fix: regenerate Alby Hub v1.23.0 patches against exact upstream source
Patch 1 (0001-private-route-hints.patch): - Add missing RouteHints: hints, context line (v1.23.0 added this field between Expiry and Private; old patch lacked it, causing hunk failure) - Fix amountMsat parameter name in hunk header (was 'amount' from older version) - Only regular invoice Private field is changed; MakeHoldInvoice keeps Private: !hasPublicChannels unchanged Patch 2 (0002-isolated-invoice-app-id.patch): - Fix CreateInvoice interface: amountMsat uint64 (not amount uint64) - Fix MakeInvoiceRequest: Amount/AmountSat/AmountMsat are *uint64 pointers (not Amount uint64) matching v1.23.0 struct layout - Fix MakeInvoice call: 9 args → 10 args with appId as 8th positional arg (nil, nil trailing) matching v1.23.0 signature - Fix function impl parameter: amountMsat uint64 throughout Both patches dry-run verified against exact v1.23.0 source and apply cleanly in sequence. Updated NixPatchContractTests to assert v1.23.0 context (RouteHints, amountMsat, *uint64 pointer types, 10-arg MakeInvoice call). All 233 Python tests pass. JS syntax checks pass.
This commit is contained in:
committed by
GitHub
parent
614f750032
commit
c449044dcf
@@ -1188,6 +1188,10 @@ class NixPatchContractTests(unittest.TestCase):
|
||||
repo_root = Path(__file__).resolve().parents[2]
|
||||
patch_path = repo_root / "packages" / "albyhub" / "0001-private-route-hints.patch"
|
||||
text = patch_path.read_text()
|
||||
# v1.23.0 source has RouteHints field between Expiry and Private; the
|
||||
# patch must include it as context or the hunk will fail to apply.
|
||||
self.assertIn("RouteHints: hints,", text)
|
||||
# Old value (context / removed line) and new value (added line).
|
||||
self.assertIn("Private: !hasPublicChannels", text)
|
||||
self.assertIn("Private: true", text)
|
||||
|
||||
@@ -1199,8 +1203,17 @@ class NixPatchContractTests(unittest.TestCase):
|
||||
self.assertIn("diff --git a/api/transactions.go b/api/transactions.go", text)
|
||||
self.assertIn("diff --git a/http/http_service.go b/http/http_service.go", text)
|
||||
self.assertIn("diff --git a/wails/wails_handlers.go b/wails/wails_handlers.go", text)
|
||||
self.assertIn("AppId *uint `json:\"appId\"`", text)
|
||||
self.assertIn("CreateInvoice(ctx context.Context, amount uint64, description string, appId *uint)", text)
|
||||
# v1.23.0 AppId field in MakeInvoiceRequest
|
||||
self.assertIn("AppId *uint", text)
|
||||
self.assertIn('json:"appId"', text)
|
||||
# v1.23.0 uses amountMsat (not amount) in the CreateInvoice signature
|
||||
self.assertIn(
|
||||
"CreateInvoice(ctx context.Context, amountMsat uint64, description string, appId *uint)",
|
||||
text,
|
||||
)
|
||||
# MakeInvoice call must pass appId as 8th positional argument (not nil)
|
||||
self.assertIn("MakeInvoice(ctx, amountMsat, description,", text)
|
||||
self.assertIn(", appId, nil, nil)", text)
|
||||
|
||||
def test_nwc_lnurl_service_runs_as_albyhub(self):
|
||||
"""nwc-lnurl.service must run as albyhub to read /var/lib/albyhub/unlock-password."""
|
||||
|
||||
Reference in New Issue
Block a user