Skip to content

Commit

Permalink
chore: remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Dec 12, 2023
1 parent 75e82d2 commit 0f2e9f1
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions alby.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ func (svc *AlbyOAuthService) LookupInvoice(ctx context.Context, senderPubkey str
}

func (svc *AlbyOAuthService) GetInfo(ctx context.Context, senderPubkey string) (info *NodeInfo, err error) {
alias := "getalby.com"
app := App{}
err = svc.db.Preload("User").First(&app, &App{
NostrPubkey: senderPubkey,
Expand All @@ -281,55 +280,20 @@ func (svc *AlbyOAuthService) GetInfo(ctx context.Context, senderPubkey string) (
}).Errorf("App not found: %v", err)
return nil, err
}
// tok, err := svc.FetchUserToken(ctx, app)
// if err != nil {
// return nil, err
// }
//client := svc.oauthConf.Client(ctx, tok)

// req, err := http.NewRequest("GET", fmt.Sprintf("%s/getinfo", svc.cfg.AlbyAPIURL), nil)
// if err != nil {
// svc.Logger.WithError(err).Error("Error creating request /getinfo")
// return nil, err
// }

// req.Header.Set("User-Agent", "NWC")

// resp, err := client.Do(req)
// if err != nil {
// svc.Logger.WithFields(logrus.Fields{
// "senderPubkey": senderPubkey,
// "appId": app.ID,
// "userId": app.User.ID,
// }).Errorf("Failed to fetch node info: %v", err)
// return nil, err
// }

// if resp.StatusCode < 300 {

svc.Logger.WithFields(logrus.Fields{
"senderPubkey": senderPubkey,
"appId": app.ID,
"userId": app.User.ID,
}).Info("Info fetch successful")
return &NodeInfo{
Alias: alias,
Alias: "getalby.com",
Color: "",
Pubkey: "",
Network: "mainnet",
BlockHeight: 0,
BlockHash: "",
}, err
// }

// errorPayload := &ErrorResponse{}
// err = json.NewDecoder(resp.Body).Decode(errorPayload)
// svc.Logger.WithFields(logrus.Fields{
// "senderPubkey": senderPubkey,
// "appId": app.ID,
// "userId": app.User.ID,
// // "APIHttpStatus": resp.StatusCode,
// }).Errorf("Invoices listing failed %s", string(errorPayload.Message))
// return nil, errors.New(errorPayload.Message)
}

func (svc *AlbyOAuthService) GetBalance(ctx context.Context, senderPubkey string) (balance int64, err error) {
Expand Down

0 comments on commit 0f2e9f1

Please sign in to comment.