store: type the retry test's expire for Postgres

This commit is contained in:
shum committed 2026-10-22 12:32:56 +00:00
1 parent 6e92698e1e
commit f127e373d6
1 file changed
+1
@@ -851,6 +851,7 @@ testRetryReleasedCode = withWorker $ \W {wCtx = ctx@Ctx {cStore}} -> do
("revoked", \PrepaidCode {pcCodeHash} db -> void $ revokePrepaidCode db pcCodeHash orderTime, refusedWith 400 "code_invalid"),
("expired", \PrepaidCode {pcCodeHash} db -> expire db pcCodeHash, refusedWith 409 "code_expired")
]
expire :: DB.Connection -> ByteString -> IO ()
expire db codeHash = DB.execute db "UPDATE sx_badge_service_name_prepaid_codes SET expires_at = ? WHERE code_hash = ?" (orderTime, DB.Binary codeHash)
forM_ (zip [1 :: Int ..] refusals) $ \(n, (what, change, refusal)) -> do
(r, code) <- codeOrder n failedPhase >>= released