diff --git a/apps/simplex-badge-service/README.md b/apps/simplex-badge-service/README.md index e642d4de95..2d3c2153f3 100644 --- a/apps/simplex-badge-service/README.md +++ b/apps/simplex-badge-service/README.md @@ -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). diff --git a/src/Simplex/Chat/Badges/Service.hs b/src/Simplex/Chat/Badges/Service.hs index 7e944d59db..4d66643a17 100644 --- a/src/Simplex/Chat/Badges/Service.hs +++ b/src/Simplex/Chat/Badges/Service.hs @@ -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" diff --git a/tests/Bots/BadgeServiceTests.hs b/tests/Bots/BadgeServiceTests.hs index 0559691dec..d6ba2b8b6e 100644 --- a/tests/Bots/BadgeServiceTests.hs +++ b/tests/Bots/BadgeServiceTests.hs @@ -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 $