From 6ace073d9c01cb9c2a0f25697322418cf0ff2f75 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Thu, 19 Sep 2024 11:43:47 +0300 Subject: [PATCH] wip --- fixme-new/lib/Fixme/Run/Internal.hs | 2 ++ hbs2-keyman/hbs2-keyman/Main.hs | 16 +++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/fixme-new/lib/Fixme/Run/Internal.hs b/fixme-new/lib/Fixme/Run/Internal.hs index cbae6037..1b6c6668 100644 --- a/fixme-new/lib/Fixme/Run/Internal.hs +++ b/fixme-new/lib/Fixme/Run/Internal.hs @@ -658,6 +658,8 @@ refchanImport = do Left (txh, orig, href, gk) -> do hx <- writeAsMerkle sto (serialise gk) notice $ "import GK" <+> pretty hx <+> "from" <+> pretty href + -- let tx = AnnotatedHashRef _ href <- deserialiseOrFail @AnnotatedHashRef (LBS.fromStrict bs) + -- & toMPlus . either (const Nothing) Just insertScanned txh -- TODO: ASAP-notify-hbs2-keyman -- у нас два варианта: diff --git a/hbs2-keyman/hbs2-keyman/Main.hs b/hbs2-keyman/hbs2-keyman/Main.hs index 37a4ecf6..ba3fdabe 100644 --- a/hbs2-keyman/hbs2-keyman/Main.hs +++ b/hbs2-keyman/hbs2-keyman/Main.hs @@ -177,15 +177,21 @@ updateKeys = do -- будет болтаться, если она не AnnotatedHashRef lift $ lift $ S.yield (Left tx0) - gk <- deserialiseOrFail @(GroupKey 'Symm HBS2Basic) gkbs & toMPlus + let gkz1 = deserialiseOrFail @(GroupKey 'Symm HBS2Basic) gkbs + & either mempty List.singleton - gkId <- getGroupKeyId gk & toMPlus + let gkz2 = deserialiseOrFail @[GroupKey 'Symm HBS2Basic] gkbs + & fromRight mempty - --TODO: verify-group-key-id-if-possible + for_ (gkz1 <> gkz2) $ \gk -> do - notice $ green "found new gk0" <+> pretty gkId <+> pretty gkh + gkId <- getGroupKeyId gk & toMPlus - lift $ lift $ S.yield (Right (gkId, gkh, gk) ) + --TODO: verify-group-key-id-if-possible + + notice $ green "found new gk0" <+> pretty gkId <+> pretty gkh + + lift $ lift $ S.yield (Right (gkId, gkh, gk) ) _ -> do lift $ S.yield (Left tx0)