next iteration fixes

This commit is contained in:
Alain Brenzikofer
2026-09-06 18:47:23 +02:00
parent 5c480277d6
commit 3b4a7f2295
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ mapAvailability NameStatusResp {nsStatus, nsExpires, nsGraceEnds, nsAuctionEnds,
"expired" -> Right NAVailable
"grace" -> Right $ maybe lapsed NAInGrace nsGraceEnds
"auction" -> Right $ fromMaybe lapsed (NAAuction <$> nsPremium <*> nsAuctionEnds)
"reserved" -> Right $ NAReserved (maybe NRUnspecified mapReason nsReasonCode)
"reserved" -> Right $ NAReserved (maybe NRUnknown mapReason nsReasonCode)
"registered" -> Right $ NATaken nsExpires
-- registered, but its records point nowhere
"noResolver" -> Right $ NATaken nsExpires
+2 -1
View File
@@ -118,8 +118,9 @@ availabilitySpec = do
(NAAuction "99999952316384526016153087" 1798191621)
it "a reserved name says why it is held back" $
answers status404 "{\"error\":\"reserved\",\"reasonCode\":\"trademark\"}" (NAReserved NRTrademark)
-- an older resolver sends no reasonCode; that is not the chain saying "none"
it "a reserved name with no reasonCode at all is still reserved" $
answers status404 "{\"error\":\"reserved\"}" (NAReserved NRUnspecified)
answers status404 "{\"error\":\"reserved\"}" (NAReserved NRUnknown)
-- a later version may name reasons this one cannot; the reservation must
-- survive that, or a client would offer a name it cannot register
it "a reason from a later version still reads as reserved" $