def decide.said

ezx@1.11.0.0 · src/add/hub.bend:135

import ezx@1.11.0.0/src/add/hub.bend as Hub
import Base
import ezx@1.11.0.0/src/add/world.bend as A
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/lock/lock.bend as L

135# what the hub said the name names
136def decide.said(answer: W.Answer, +world: A.World) -> Verdict:
137  match answer:
138    case W.Said{text}:
139      +hash = String.trim(text)
140      decide.hash(L.hash.ok(hash), hash, world)
141    case W.Miss{+why}:
142      Stop{"ez: the hub at " ++ A.hub(world) ++ " has no package " ++ nv(world) ++ " (" ++
143        unsaid(String.starts_with(why, "ez: "), why) ++ ")"}
144    case _:
145      Stop{"ez: " ++ nv(world) ++ " was not answered with a hash"}

Uses (11)

Used by (1)