Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
fix(daemon): lndhub tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juligasa committed Jun 25, 2024
1 parent df266ac commit c822534
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions backend/lndhub/lndhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,15 @@ func (c *Client) GetLndaddressDomain() string {
// fail otherwise).
func (c *Client) Create(ctx context.Context, connectionURL, login, pass, nickname string) (createResponse, error) {
var resp createResponse
pubKey, err := c.keyStorage.GetKey(ctx, c.keyName)
kp, err := c.keyStorage.GetKey(ctx, c.keyName)
if err != nil {
return resp, fmt.Errorf("could not get signing key, is account initialized?: %w", err)
}
pubKeyBytes, err := pubKey.PublicKey.MarshalBinary()
pubKey, err := kp.ID().ExtractPublicKey()
if err != nil {
return resp, fmt.Errorf("Invalid pubkey: %w", err)
}
pubKeyBytes, err := pubKey.Raw()
if err != nil {
return resp, fmt.Errorf("Invalid pubkey: %w", err)
}
Expand Down Expand Up @@ -172,7 +176,7 @@ func (c *Client) UpdateNickname(ctx context.Context, nickname string) error {
return fmt.Errorf("Nickname cannot contain uppercase letters %s", nickname)
}
}
pubKey, err := c.keyStorage.GetKey(ctx, c.keyName)
kp, err := c.keyStorage.GetKey(ctx, c.keyName)
if err != nil {
return fmt.Errorf("could not get signing key, is account initialized?: %w", err)
}
Expand All @@ -196,7 +200,11 @@ func (c *Client) UpdateNickname(ctx context.Context, nickname string) error {
if err != nil {
return err
}
pubKeyBytes, err := pubKey.PublicKey.MarshalBinary()
pubKey, err := kp.ID().ExtractPublicKey()
if err != nil {
return fmt.Errorf("Invalid pubkey: %w", err)
}
pubKeyBytes, err := pubKey.Raw()
if err != nil {
return fmt.Errorf("Invalid pubkey: %w", err)
}
Expand Down

0 comments on commit c822534

Please sign in to comment.