Merge pull request #4019 from urbit/lf/safe-update-log-peek

graph-store: safely peek update-log
This commit is contained in:
matildepark 2020-11-25 00:24:38 -05:00 committed by GitHub
commit 91df3ca710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -748,12 +748,14 @@
[%x %peek-update-log @ @ ~]
=/ =ship (slav %p i.t.t.path)
=/ =term i.t.t.t.path
=/ update-log=(unit update-log:store) (~(get by update-logs) [ship term])
?~ update-log [~ ~]
=/ result=(unit [time update:store])
(peek:orm-log:store u.update-log)
?~ result [~ ~]
``noun+!>([~ -.u.result])
=/ m-update-log=(unit update-log:store) (~(get by update-logs) [ship term])
:- ~ :- ~ :- %noun
!> ^- (unit time)
%+ biff m-update-log
|= =update-log:store
=/ result=(unit [=time =update:store])
(peek:orm-log:store update-log)
(bind result |=([=time update:store] time))
==
::
++ get-node