From edafccea465f1f9448a1a7ae555b8615e5b5ac1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 2 Jul 2023 20:02:11 +0200 Subject: Shared state helpers usable with other local head updates --- src/Test.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Test.hs') 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 -- cgit v1.2.3