teller: hold an answer's warrant to the ask as the channel was asked it, its words cut

#228 cut long hexadecimal runs from an assigner ask's words but checked the warrant against the assigner's whole words:
the operator's answer to mesh-hand-acts' backup ask on novox (20:19) was refused as no longer the ask answered.
This commit is contained in:
2026-11-16 20:21:17 +01:00
parent 92c87aac6c
commit 4eef3e6c4d
@@ -180,8 +180,9 @@ func (t *Teller) answerAssigner(key string, o oc.Option, w oc.Warrant) error {
t.logf("%s: the ask %s was answered, and the assigner has asked again under %s: an answer to an earlier asking changes nothing", key, w.Ask, a.Ask.ID) t.logf("%s: the ask %s was answered, and the assigner has asked again under %s: an answer to an earlier asking changes nothing", key, w.Ask, a.Ask.ID)
return nil return nil
} }
if occ.Digest(a.Ask) != w.AskDigest { // The warrant is over the ask as the channel was asked it, its words cut (shortWords), not as the assigner keeps it.
return fmt.Errorf("the assigner's ask %s is no longer the ask the operator answered (its digest is %s, the warrant's %s)", key, occ.Digest(a.Ask), w.AskDigest) if d := occ.Digest(shortWords(a.Ask)); d != w.AskDigest {
return fmt.Errorf("the assigner's ask %s is no longer the ask the operator answered (its digest is %s, the warrant's %s)", key, d, w.AskDigest)
} }
body, err := meshdeliveryclient.EncodeAnswer(meshdeliveryclient.Answer{Option: o.ID, Warrant: warrantID(w), Words: occ.Says(w)}) body, err := meshdeliveryclient.EncodeAnswer(meshdeliveryclient.Answer{Option: o.ID, Warrant: warrantID(w), Words: occ.Says(w)})
if err != nil { if err != nil {