From d35aef85c9efd5b35341af892926a7f6658edfc7 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Wed, 23 Sep 2026 10:11:05 +0200 Subject: [PATCH] reuse existing types --- cabal.project | 2 +- scripts/nix/sha256map.nix | 2 +- tests/NameResolver.hs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cabal.project b/cabal.project index 5861dcb423..9d7c2d5028 100644 --- a/cabal.project +++ b/cabal.project @@ -21,7 +21,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: 1d82c0815dcf005f4bbb84c307bae13cb51cdd6b + tag: 78ebf1cb2eae5c5012829336e4df1b25e8314551 source-repository-package type: git diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 38c305213c..9a0473dd58 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."1d82c0815dcf005f4bbb84c307bae13cb51cdd6b" = "0mhdwzqcsm6mw55j68xv68g61awf33wl39slk5mr5jxsrlph66yx"; + "https://github.com/simplex-chat/simplexmq.git"."78ebf1cb2eae5c5012829336e4df1b25e8314551" = "0x1asli9d70p3ywzxy4r442sqn3dlif1i5a8lnk9k55qc79hr1c8"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "1ql13f4kfwkbaq7nygkxgw84213i0zm7c1a8hwvramayxl38dq5d"; "https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl"; diff --git a/tests/NameResolver.hs b/tests/NameResolver.hs index 1409c2cfda..c9fdd975c8 100644 --- a/tests/NameResolver.hs +++ b/tests/NameResolver.hs @@ -27,10 +27,9 @@ import Network.HTTP.Types (hContentType, notFound404, ok200) import Network.Wai (Application, pathInfo, responseLBS) import qualified Network.Wai.Handler.Warp as Warp import Simplex.Messaging.Encoding.String (strEncode) -import Simplex.Messaging.Names.Record (NamePricing (..), NameRecord (..), NameRegistration (..), NameResponse (..), OwnedName (..), OwnedNames (..), USDCents (..)) +import Simplex.Messaging.Names.Record (NamePricing (..), NameRecord (..), NameRegistration (..), NameResponse (..), OwnedNames (..), USDCents (..)) import Simplex.Messaging.Server.Names (NamesConfig (..)) import Simplex.Messaging.SimplexName (SimplexDomain (..), SimplexNameInfo (..), labelHash) -import Simplex.Messaging.SystemTime (RoundedSystemTime (..)) type NameRegistry = TVar (Map Text NameRecord) @@ -53,7 +52,7 @@ withNameResolver action = do nameResponse Nothing = NameResponse {lastBlockTs = Nothing, registration = NRAvailable {pricing = NamePricing {registrationPrices = M.empty, basePrice = USDCents 1000, minLabelLength = 1}}} -- an account is in use when it owns a name, the only thing this resolver knows about ownedNames addr rs = - let ns = [OwnedName {onName = Just nrName, onLabelhash = "", onExpires = RoundedSystemTime 0, onStatus = "registered"} | NameRecord {nrName, nrOwner} <- rs, nrOwner == addr] + let ns = [nameResponse (Just r) | r@NameRecord {nrOwner} <- rs, nrOwner == addr] in OwnedNames {ownNames = ns, ownInUse = not (null ns), ownNextOffset = Nothing} -- | Register a name's domain to resolve to the given record.