Skip to content

Commit

Permalink
Remove until validation in restapi when creating an availability
Browse files Browse the repository at this point in the history
  • Loading branch information
2-towns committed Feb 21, 2025
1 parent 2b02d38 commit dba109f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions codex/rest/api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,6 @@ proc initSalesApi(node: CodexNodeRef, router: var RestRouter) =
Http400, "Total size must be larger then zero", headers = headers
)

let until = restAv.until |? 0
if until < 0:
return RestApiResponse.error(
Http400,
"Until parameter must be greater or equal 0. Got: " & $until,
headers = headers,
)

if not reservations.hasAvailable(restAv.totalSize.truncate(uint)):
return
RestApiResponse.error(Http422, "Not enough storage quota", headers = headers)
Expand All @@ -482,7 +474,7 @@ proc initSalesApi(node: CodexNodeRef, router: var RestRouter) =
restAv.minPricePerBytePerSecond,
restAv.totalCollateral,
enabled = restAv.enabled |? true,
until = until,
until = restAv.until |? 0,
)
), error:
return RestApiResponse.error(Http500, error.msg, headers = headers)
Expand Down

0 comments on commit dba109f

Please sign in to comment.