mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-29 12:49:53 +00:00
core: remove a separate type to validate servers with invalid addresses (they are prevented by the UI) (#5211)
This commit is contained in:
parent
70a29512b7
commit
4b9c618ae3
3 changed files with 15 additions and 67 deletions
|
@ -44,8 +44,6 @@ validateServersTest = describe "validate user servers" $ do
|
|||
[ USEDuplicateServer aSMP "smp://0YuTwO05YJWS8rkjn9eLJDjQhFKvIYd8d4xG8X1blIU=@smp8.simplex.im,beccx4yfxxbvyhqypaavemqurytl6hozr47wfc7uuecacjqdvwpw2xid.onion" "smp8.simplex.im",
|
||||
USEDuplicateServer aSMP "smp://abcd@smp8.simplex.im" "smp8.simplex.im"
|
||||
]
|
||||
it "should fail with invalid host" $ do
|
||||
validateUserServers [invalidHost] [] `shouldBe` [USENoServers aXFTP Nothing, USEInvalidServer aSMP "smp:abcd@smp8.simplex.im"]
|
||||
where
|
||||
aSMP = AProtocolType SPSMP
|
||||
aXFTP = AProtocolType SPXFTP
|
||||
|
@ -132,14 +130,3 @@ invalidDuplicate =
|
|||
(valid :: UpdatedUserOperatorServers)
|
||||
{ smpServers = map (AUS SDBNew) $ simplexChatSMPServers <> [presetServer True "smp://abcd@smp8.simplex.im"]
|
||||
}
|
||||
|
||||
invalidHost :: ValidatedUserOperatorServers
|
||||
invalidHost =
|
||||
ValidatedUserOperatorServers
|
||||
{ operator = Just operatorSimpleXChat {operatorId = DBEntityId 1},
|
||||
smpServers = [validatedServer (Left "smp:abcd@smp8.simplex.im"), validatedServer (Right "smp://abcd@smp8.simplex.im")],
|
||||
xftpServers = []
|
||||
}
|
||||
where
|
||||
validatedServer srv =
|
||||
AVS SDBNew (presetServer @'PSMP True "smp://abcd@smp8.simplex.im") {server = ValidatedProtoServer srv}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue