mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
c1c9927b9a
commit
6ace073d9c
|
@ -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
|
||||
-- у нас два варианта:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue