mirror of https://github.com/voidlizard/hbs2
wip, fixed refchan head pretty printing
This commit is contained in:
parent
73193b5511
commit
a1f2942610
|
@ -272,13 +272,13 @@ instance (ForRefChans e
|
||||||
<>
|
<>
|
||||||
parens ("wait" <+> pretty (view refChanHeadWaitAccept blk)) <> line
|
parens ("wait" <+> pretty (view refChanHeadWaitAccept blk)) <> line
|
||||||
<>
|
<>
|
||||||
vcat (fmap peer (HashMap.toList $ view refChanHeadPeers blk)) <> line
|
lstOf peer (HashMap.toList $ view refChanHeadPeers blk)
|
||||||
<>
|
<>
|
||||||
vcat (fmap author (HashSet.toList $ view refChanHeadAuthors blk)) <> line
|
lstOf author (HashSet.toList $ view refChanHeadAuthors blk)
|
||||||
<>
|
<>
|
||||||
vcat (fmap reader (HashSet.toList $ view refChanHeadReaders blk)) <> line
|
lstOf reader (HashSet.toList $ view refChanHeadReaders blk)
|
||||||
<>
|
<>
|
||||||
vcat (fmap notifier (HashSet.toList $ view refChanHeadNotifiers blk)) <> line
|
lstOf notifier (HashSet.toList $ view refChanHeadNotifiers blk)
|
||||||
|
|
||||||
where
|
where
|
||||||
peer (p,w) = parens ("peer" <+> dquotes (pretty (AsBase58 p)) <+> pretty w)
|
peer (p,w) = parens ("peer" <+> dquotes (pretty (AsBase58 p)) <+> pretty w)
|
||||||
|
@ -286,6 +286,9 @@ instance (ForRefChans e
|
||||||
reader p = parens ("reader" <+> dquotes (pretty (AsBase58 p)))
|
reader p = parens ("reader" <+> dquotes (pretty (AsBase58 p)))
|
||||||
notifier p = parens ("notifier" <+> dquotes (pretty (AsBase58 p)))
|
notifier p = parens ("notifier" <+> dquotes (pretty (AsBase58 p)))
|
||||||
|
|
||||||
|
lstOf f e | null e = mempty
|
||||||
|
| otherwise = vcat (fmap f e) <> line
|
||||||
|
|
||||||
|
|
||||||
-- блок головы может быть довольно большой.
|
-- блок головы может быть довольно большой.
|
||||||
-- поэтому посылаем его, как merkle tree
|
-- поэтому посылаем его, как merkle tree
|
||||||
|
|
Loading…
Reference in New Issue