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:
copilot-swe-agent[bot]
2026-07-27 10:49:25 +00:00
committed by GitHub
parent 614f750032
commit c449044dcf
3 changed files with 51 additions and 42 deletions
@@ -1,58 +1,55 @@
diff --git a/api/models.go b/api/models.go
index 27bc0c6..3986c0f 100644
index 28bd117..dceb79a 100644
--- a/api/models.go
+++ b/api/models.go
@@ -43,7 +43,7 @@ type API interface {
GetBalances(ctx context.Context) (*BalancesResponse, error)
@@ -46,7 +46,7 @@ type API interface {
ListTransactions(ctx context.Context, appId *uint, limit uint64, offset uint64) (*ListTransactionsResponse, error)
SendPayment(ctx context.Context, invoice string, amountMsat *uint64) (*SendPaymentResponse, error)
- CreateInvoice(ctx context.Context, amount uint64, description string) (*MakeInvoiceResponse, error)
+ CreateInvoice(ctx context.Context, amount uint64, description string, appId *uint) (*MakeInvoiceResponse, error)
ListOnchainTransactions(ctx context.Context) ([]OnchainTransaction, error)
SendPayment(ctx context.Context, invoice string, amountMsat *uint64, metadata map[string]interface{}, fromAppId *uint) (*SendPaymentResponse, error)
- CreateInvoice(ctx context.Context, amountMsat uint64, description string) (*MakeInvoiceResponse, error)
+ CreateInvoice(ctx context.Context, amountMsat uint64, description string, appId *uint) (*MakeInvoiceResponse, error)
LookupInvoice(ctx context.Context, paymentHash string) (*LookupInvoiceResponse, error)
RequestMempoolApi(endpoint string) (interface{}, error)
GetInfo(ctx context.Context) (*InfoResponse, error)
@@ -308,8 +308,9 @@ type PayInvoiceRequest struct {
}
type MakeInvoiceRequest struct {
- Amount uint64 `json:"amount"`
- Description string `json:"description"`
+ Amount uint64 `json:"amount"`
+ Description string `json:"description"`
+ AppId *uint `json:"appId"`
SetTransactionUserLabels(ctx context.Context, id uint, labels map[string]string) error
RequestMempoolApi(ctx context.Context, endpoint string) (interface{}, error)
@@ -586,6 +586,7 @@ type MakeInvoiceRequest struct {
AmountSat *uint64 `json:"amountSat"`
AmountMsat *uint64 `json:"amountMsat"`
Description string `json:"description"`
+ AppId *uint `json:"appId"`
}
type ResetRouterRequest struct {
diff --git a/api/transactions.go b/api/transactions.go
index 8a10267..ce8e080 100644
index aaf9380..3f9850a 100644
--- a/api/transactions.go
+++ b/api/transactions.go
@@ -13,11 +13,11 @@ import (
@@ -12,12 +12,12 @@ import (
"github.com/sirupsen/logrus"
)
-func (api *api) CreateInvoice(ctx context.Context, amount uint64, description string) (*MakeInvoiceResponse, error) {
+func (api *api) CreateInvoice(ctx context.Context, amount uint64, description string, appId *uint) (*MakeInvoiceResponse, error) {
if api.svc.GetLNClient() == nil {
return nil, errors.New("LNClient not started")
-func (api *api) CreateInvoice(ctx context.Context, amountMsat uint64, description string) (*MakeInvoiceResponse, error) {
+func (api *api) CreateInvoice(ctx context.Context, amountMsat uint64, description string, appId *uint) (*MakeInvoiceResponse, error) {
lnClient := api.svc.GetLNClient()
if lnClient == nil {
return nil, ErrLNClientNotStarted
}
- transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amount, description, "", 0, nil, api.svc.GetLNClient(), nil, nil)
+ transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amount, description, "", 0, nil, api.svc.GetLNClient(), appId, nil)
- transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amountMsat, description, "", 0, nil, lnClient, nil, nil, nil)
+ transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amountMsat, description, "", 0, nil, lnClient, appId, nil, nil)
if err != nil {
return nil, err
}
diff --git a/http/http_service.go b/http/http_service.go
index 1ec1de6..84a2650 100644
index bf650b9..cf61250 100644
--- a/http/http_service.go
+++ b/http/http_service.go
@@ -518,7 +518,12 @@ func (httpSvc *HttpService) makeInvoiceHandler(c echo.Context) error {
})
@@ -687,7 +687,12 @@ func (httpSvc *HttpService) makeInvoiceHandler(c echo.Context) error {
amountMsat = *resolvedAmountMsat
}
- invoice, err := httpSvc.api.CreateInvoice(c.Request().Context(), makeInvoiceRequest.Amount, makeInvoiceRequest.Description)
- invoice, err := httpSvc.api.CreateInvoice(c.Request().Context(), amountMsat, makeInvoiceRequest.Description)
+ invoice, err := httpSvc.api.CreateInvoice(
+ c.Request().Context(),
+ makeInvoiceRequest.Amount,
+ amountMsat,
+ makeInvoiceRequest.Description,
+ makeInvoiceRequest.AppId,
+ )
@@ -60,15 +57,15 @@ index 1ec1de6..84a2650 100644
if err != nil {
return c.JSON(http.StatusInternalServerError, ErrorResponse{
diff --git a/wails/wails_handlers.go b/wails/wails_handlers.go
index 1ca87f2..8b91f68 100644
index d25259b..c9fe4e8 100644
--- a/wails/wails_handlers.go
+++ b/wails/wails_handlers.go
@@ -634,7 +634,7 @@ func (app *WailsApp) WailsRequestRouter(route string, method string, body strin
return WailsRequestRouterResponse{Body: nil, Error: err.Error()}
}
@@ -600,7 +600,7 @@ func (app *WailsApp) WailsRequestRouter(route string, method string, body string
if resolvedAmountMsat != nil {
amountMsat = *resolvedAmountMsat
}
- invoice, err := app.api.CreateInvoice(ctx, makeInvoiceRequest.Amount, makeInvoiceRequest.Description)
+ invoice, err := app.api.CreateInvoice(ctx, makeInvoiceRequest.Amount, makeInvoiceRequest.Description, nil)
- invoice, err := app.api.CreateInvoice(ctx, amountMsat, makeInvoiceRequest.Description)
+ invoice, err := app.api.CreateInvoice(ctx, amountMsat, makeInvoiceRequest.Description, nil)
if err != nil {
return WailsRequestRouterResponse{Body: nil, Error: err.Error()}
}