def seen.hash

ezx@1.11.0.0 · src/pub/plan.bend:928

import ezx@1.11.0.0/src/pub/plan.bend as Plan
import Base
import ezx@1.11.0.0/src/lock/lock.bend as L
import ezx@1.11.0.0/src/share/sha.bend as Sha

928# a manifest the hub served for a `0x` name: the package is there when the
929# manifest hashes to the name, as `ez lock` checks it
930def seen.hash(ok: Bool, +hash: String, +text: String, +who: String) -> Seen:
931  match ok:
932    case True{}:
933      Bool.pick(Seen, String.starts_with(Sha.hex(text), L.want(hash)), There{},
934        Off{"  " ++ who ++ ": the hub served a manifest that does not hash to it"})
935    case False{}:
936      seen.miss(absent(text), text, who)

Uses (10)

Used by (1)