Skip to content

Commit

Permalink
simplified boolean MakeDeal func; mark handlePinAddToNodeToMiners for…
Browse files Browse the repository at this point in the history
… removal
  • Loading branch information
10d9e committed Jun 8, 2023
1 parent 0f093dd commit 2897036
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions api/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ func handleUploadToCarBucketAndMiners(node *core.LightNode, DeltaUploadApi strin
return nil
}
}

// TODO: remove this if not used
func handlePinAddToNodeToMiners(node *core.LightNode, DeltaUploadApi string) func(c echo.Context) error {
return func(c echo.Context) error {
authorizationString := c.Request().Header.Get("Authorization")
Expand Down Expand Up @@ -339,10 +341,7 @@ func handleFetchPinToNodeToMiners(node *core.LightNode, DeltaUploadApi string) f
Status: "fetching",
Miner: miner,
MakeDeal: func() bool {
if makeDeal == "true" {
return true
}
return false
return makeDeal == "true"
}(),
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
Expand Down Expand Up @@ -430,10 +429,7 @@ func handlePinAddCarToNodeToMiners(node *core.LightNode, DeltaUploadApi string)
RequestingApiKey: authParts[1],
Status: utils.STATUS_PINNED,
MakeDeal: func() bool {
if makeDeal == "true" {
return true
}
return false
return makeDeal == "true"
}(),
Miner: miner,
CreatedAt: time.Now(),
Expand Down

0 comments on commit 2897036

Please sign in to comment.