This commit is contained in:
Dmitry Zuikov 2024-08-01 14:32:30 +03:00
parent 1af1c060d0
commit 6567b39307
1 changed files with 14 additions and 0 deletions

View File

@ -165,4 +165,18 @@ reflogEntries = do
_ -> throwIO (BadFormException @C nil) _ -> throwIO (BadFormException @C nil)
brief "list transactions from reflog"
$ entry $ bindMatch "hbs2:reflog:tx:parse" $ \case
[StringLike hash] -> do
sto <- ContT withPeerStorage
hashref <- orThrowUser "bad hash" (fromStringMay @HashRef hash)
void $ hasBlock sto (fromHashRef hashref) `orDie` "no block"
let sref = AnnotatedHashRef Nothing hashref
rlu <- lift $ mkRefLogUpdateFrom reflog (pure $ LBS.toStrict $ serialise sref) <&> serialise
pure $ mkForm "blob" [mkStr (LBS8.unpack rlu)]
_ -> throwIO (BadFormException @C nil)