summaryrefslogtreecommitdiff
path: root/src/Test.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-07-02 20:02:11 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-07-02 21:52:57 +0200
commitedafccea465f1f9448a1a7ae555b8615e5b5ac1b (patch)
tree85e7b6b5c4e610c27552ad4a8ecb4c4da764ade7 /src/Test.hs
parent5afb63aced2a6c5ec2fd3604f1b898d803686d8d (diff)
Shared state helpers usable with other local head updates
Diffstat (limited to 'src/Test.hs')
-rw-r--r--src/Test.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Test.hs b/src/Test.hs
index 04a5c9c..84505c2 100644
--- a/src/Test.hs
+++ b/src/Test.hs
@@ -404,7 +404,7 @@ cmdWatchSharedIdentity = do
cmdUpdateLocalIdentity :: Command
cmdUpdateLocalIdentity = do
[name] <- asks tiParams
- updateLocalState_ $ \ls -> liftIO $ do
+ updateLocalHead_ $ \ls -> liftIO $ do
Just identity <- return $ validateIdentity $ lsIdentity $ fromStored ls
let st = storedStorage ls
public = idKeyIdentity identity
@@ -420,7 +420,7 @@ cmdUpdateLocalIdentity = do
cmdUpdateSharedIdentity :: Command
cmdUpdateSharedIdentity = do
[name] <- asks tiParams
- updateSharedState_ $ \case
+ updateLocalHead_ $ updateSharedState_ $ \case
Nothing -> throwError "no existing shared identity"
Just identity -> liftIO $ do
let st = storedStorage $ head $ idDataF identity
@@ -486,7 +486,7 @@ cmdContactSetName = do
[contact] <- flip filterM contacts $ \c -> do
r:_ <- return $ filterAncestors $ concatMap storedRoots $ toComponents c
return $ T.pack (show $ refDigest $ storedRef r) == cid
- updateSharedState_ $ contactSetName contact name
+ updateLocalHead_ $ updateSharedState_ $ contactSetName contact name
cmdOut "contact-set-name-done"
cmdDmSendPeer :: Command