mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-09-17 05:55:04 +00:00
Add iOS smoke test at createAgentStore
This commit is contained in:
@@ -30,6 +30,10 @@ module Simplex.Messaging.Agent.Env.SQLite
|
||||
)
|
||||
where
|
||||
|
||||
-- iOS FunPtr smoke test
|
||||
import Simplex.Messaging.Crypto.SNTRUP761.Bindings
|
||||
import Simplex.Messaging.Crypto.SNTRUP761.Bindings.RNG
|
||||
|
||||
import Control.Monad.Except
|
||||
import Control.Monad.IO.Unlift
|
||||
import Control.Monad.Reader
|
||||
@@ -195,7 +199,18 @@ newSMPAgentEnv config@AgentConfig {initialClientId} store = do
|
||||
pure Env {config, store, idsDrg, clientCounter, randomServer, ntfSupervisor, xftpAgent}
|
||||
|
||||
createAgentStore :: FilePath -> String -> MigrationConfirmation -> IO (Either MigrationError SQLiteStore)
|
||||
createAgentStore dbFilePath dbKey = createSQLiteStore dbFilePath dbKey Migrations.app
|
||||
createAgentStore dbFilePath dbKey cfg = do
|
||||
withHaskellRNG $ \rng -> do
|
||||
(pk, sk) <- sntrup761KeypairWith rng
|
||||
(c, k) <- sntrup761EncWith rng pk
|
||||
k' <- sntrup761Dec c sk
|
||||
if k /= k' then
|
||||
fail "sntrup761 smoke test failed"
|
||||
else
|
||||
putStrLn "sntrup761 smoke test passed"
|
||||
|
||||
createSQLiteStore dbFilePath dbKey Migrations.app cfg
|
||||
|
||||
|
||||
data NtfSupervisor = NtfSupervisor
|
||||
{ ntfTkn :: TVar (Maybe NtfToken),
|
||||
|
||||
Reference in New Issue
Block a user