Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenlu committed Sep 18, 2024
1 parent 67e116c commit e7ae80a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions examples/uma-server/vasp1.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ import (

// Vasp1 is an implementation of the sending VASP in the UMA protocol.
type Vasp1 struct {
config *UmaConfig
pubKeyCache uma.PublicKeyCache
requestCache *Vasp1RequestCache
nonceCache uma.NonceCache
client *services.LightsparkClient
config *UmaConfig
pubKeyCache uma.PublicKeyCache
requestCache *Vasp1RequestCache
nonceCache uma.NonceCache
client *services.LightsparkClient
umaRequestStorage *Vasp1UmaRequestStorage
}

func NewVasp1(config *UmaConfig, pubKeyCache uma.PublicKeyCache) *Vasp1 {
oneDayAgo := time.Now().AddDate(0, 0, -1)
return &Vasp1{
config: config,
pubKeyCache: pubKeyCache,
requestCache: NewVasp1RequestCache(),
nonceCache: uma.NewInMemoryNonceCache(oneDayAgo),
client: services.NewLightsparkClient(config.ApiClientID, config.ApiClientSecret, config.ClientBaseURL),
config: config,
pubKeyCache: pubKeyCache,
requestCache: NewVasp1RequestCache(),
nonceCache: uma.NewInMemoryNonceCache(oneDayAgo),
client: services.NewLightsparkClient(config.ApiClientID, config.ApiClientSecret, config.ClientBaseURL),
umaRequestStorage: &Vasp1UmaRequestStorage{},
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@ func (v *Vasp1) handlePayInvoice(context *gin.Context) {
return
}

senderNode, err := GetNode(v.client, v.config.NodeUUID)
senderNode, err := GetNode(v.client, v.config.NodeUUID)
if err != nil || senderNode == nil {
context.JSON(http.StatusInternalServerError, gin.H{
"status": "ERROR",
Expand Down Expand Up @@ -595,7 +595,7 @@ func (v *Vasp1) handlePayRequest(
payreqResponse,
*pubKeys,
v.nonceCache,
"$" + v.config.Username + "@" + v.getVaspDomain(context),
"$"+v.config.Username+"@"+v.getVaspDomain(context),
payeeIdentifier,
); err != nil {
context.JSON(http.StatusBadRequest, gin.H{
Expand Down Expand Up @@ -1041,4 +1041,4 @@ func (v *Vasp1) handleRequestPayInvoice(context *gin.Context) {

v.umaRequestStorage.AddUmaRequestToStorage(*invoice.SenderUma, invoiceString)
context.Status(http.StatusOK)
}
}

0 comments on commit e7ae80a

Please sign in to comment.