mirror of
https://github.com/getAlby/lndhub.go.git
synced 2025-12-24 08:05:02 +01:00
working on test refactoring
This commit is contained in:
@@ -35,19 +35,10 @@ type WebHookTestSuite struct {
|
||||
}
|
||||
|
||||
func (suite *WebHookTestSuite) SetupSuite() {
|
||||
lndClient, err := lnd.NewLNDclient(lnd.LNDoptions{
|
||||
Address: lnd2RegtestAddress,
|
||||
MacaroonHex: lnd2RegtestMacaroonHex,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("Error setting up funding client: %v", err)
|
||||
}
|
||||
suite.fundingClient = lndClient
|
||||
|
||||
suite.invoiceChan = make(chan models.Invoice)
|
||||
webhookServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
invoice := models.Invoice{}
|
||||
err = json.NewDecoder(r.Body).Decode(&invoice)
|
||||
err := json.NewDecoder(r.Body).Decode(&invoice)
|
||||
if err != nil {
|
||||
suite.echo.Logger.Error(err)
|
||||
close(suite.invoiceChan)
|
||||
|
||||
Reference in New Issue
Block a user