mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-14 04:59:56 +00:00
wip
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 $
|
||||
|
||||
Reference in New Issue
Block a user