chore: use limits from JWT if available

This commit is contained in:
im-adithya
2023-12-05 15:58:45 +05:30
parent 62d7ffb7fe
commit e681e69fa2
24 changed files with 133 additions and 47 deletions

View File

@@ -13,6 +13,7 @@ import (
"github.com/getAlby/lndhub.go/lib/responses"
"github.com/getAlby/lndhub.go/lib/service"
"github.com/getAlby/lndhub.go/lib/tokens"
"github.com/getAlby/lndhub.go/lnd"
"github.com/go-playground/validator/v10"
"github.com/labstack/echo/v4"
"github.com/stretchr/testify/assert"
@@ -72,7 +73,7 @@ func (suite *KeySendFailureTestSuite) SetupSuite() {
assert.Equal(suite.T(), 1, len(userTokens))
suite.aliceLogin = users[0]
suite.aliceToken = userTokens[0]
suite.echo.Use(tokens.Middleware([]byte(suite.service.Config.JWTSecret)))
suite.echo.Use(tokens.Middleware([]byte(suite.service.Config.JWTSecret), &lnd.Limits{}))
suite.echo.POST("/addinvoice", controllers.NewAddInvoiceController(suite.service).AddInvoice)
suite.echo.POST("/keysend", controllers.NewKeySendController(suite.service).KeySend)
}