Merge pull request 'teller: hold an answer's warrant to the ask as the channel was asked it' (#229) from fix/teller-short-words-warrant into main

This commit was merged in pull request #229.
This commit is contained in:
2026-11-16 19:21:28 +00:00
@@ -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)
return nil
}
if occ.Digest(a.Ask) != 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, 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.
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)})
if err != nil {