Merge pull request #5412 from urbit/jb/safer-dojo

dojo: improve safety of mark conversion
This commit is contained in:
Philip Monk 2021-12-07 20:20:53 -08:00 committed by GitHub
commit 5c20b63a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -902,6 +902,9 @@
%dv (dy-sing hand+q.bil %a p.bil (snoc q.bil %hoon))
%ge (dy-run-generator (dy-cage p.p.p.bil) q.p.bil)
%sa
=/ has-mark .?((get-fit:clay he-beak %mar p.bil))
?. has-mark
(he-diff(poy ~) %tan leaf+"dojo: %{(trip p.bil)} missing" ~)
=+ .^(=dais:clay cb+(en-beam he-beak /[p.bil]))
(dy-hand p.bil *vale:dais)
::
@ -910,8 +913,12 @@
=/ has-mark .?((get-fit:clay he-beak %mar p.bil))
?. has-mark :: yolo
(dy-hand p.bil q.cag)
=+ .^(=tube:clay cc+(en-beam he-beak /[p.cag]/[p.bil]))
(dy-hand p.bil (tube q.cag))
=/ res
=+ .^(=tube:clay cc+(en-beam he-beak /[p.cag]/[p.bil]))
(mule |.((tube q.cag)))
?: ?=(%| -.res)
(he-diff(poy ~) %tan leaf+"dojo: %as %{(trip p.bil)} failed" p.res)
(dy-hand p.bil p.res)
::
%do
=/ gat (dy-eval p.bil)