summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 93517b2..b143253 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -71,6 +71,14 @@ main = do
["update-identity"] -> updateSharedIdentity st
+ ("update-identity" : srefs) -> do
+ sequence <$> mapM (readRef st . BC.pack) srefs >>= \case
+ Nothing -> error "ref does not exist"
+ Just refs
+ | Just idt <- validateIdentityF $ map wrappedLoad refs -> do
+ BC.putStrLn . showRefDigest . refDigest . storedRef . idData =<< interactiveIdentityUpdate idt
+ | otherwise -> error "invalid identity"
+
[bhost] -> interactiveLoop st bhost
_ -> error "Expecting broadcast address"