This commit is contained in:
spaced4ndy
2026-08-06 22:47:58 +04:00
parent a2fe2afc55
commit affe0fafd6
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -27,4 +27,4 @@ simplex-badge-service --help
- default (no `--run-cli`): background service mode, no interactive terminal.
- `--run-cli`: interactive CLI that also processes service requests (mirrors `simplex-directory-service --run-cli`).
- `--no-address`: skip address creation on start-up (useful when the address was created out of band, for example in tests).
- `--no-address`: skip address creation on start-up (for operators who provision the address themselves).
+2 -2
View File
@@ -227,8 +227,6 @@ data StatementDebitType
| SDUnknown {tag :: Text, json :: J.Object}
deriving (Show)
-- Wire form is snake_case per docs/protocol/badges-rpc.schema.json.
-- Written by hand because enumJSON $ dropPrefix "BSE" would emit camelCase.
data BadgeServiceErrorCode
= BSEBadRequest
| BSEUnsupportedVersion
@@ -250,6 +248,8 @@ data BadgeServiceErrorCode
| BSEUnknown Text -- forwards-compatible: service is deployed ahead of clients
deriving (Eq, Show)
-- Wire form is snake_case per docs/protocol/badges-rpc.schema.json.
-- Written by hand because enumJSON $ dropPrefix "BSE" would emit camelCase.
instance TextEncoding BadgeServiceErrorCode where
textEncode = \case
BSEBadRequest -> "bad_request"
+1 -2
View File
@@ -55,7 +55,6 @@ mkBadgeServiceOpts TestParams {tmpPath = ps} =
withBadgeService :: HasCallStack => TestParams -> (TestCC -> String -> IO ()) -> IO ()
withBadgeService ps test = do
let opts = mkBadgeServiceOpts ps
-- Create the bot database with no address.
withNewTestChatCfg ps testCfg serviceDbPrefix badgeProfile $ \_ -> pure ()
-- First start: badge service takes the CreateMyAddress branch.
runBadgeService testCfg opts (pure ())
@@ -66,7 +65,7 @@ withBadgeService ps test = do
bs ##> "/sa"
(sLink, fullLink) <- getContactLinks bs False
bs <## "auto_accept off"
("rk=" `isInfixOf` fullLink) `shouldBe` True
("&rk=" `isInfixOf` fullLink) `shouldBe` True
pure sLink
-- Second start: badge service takes the ShowMyAddress branch, then serves the test body.
runBadgeService testCfg opts $