msggen: fix incorrect assertion.

Adding a new field with `added` fails:

```
AssertionError: Field Feerates.perkb.estimates[] does not have an `added` annotation
```

Looks like this assertion is wrong: we should get an added from the field itself or
from the .msggen.json file.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-04-07 14:08:05 +09:30
parent ca80dee514
commit b53cc69cfd

View file

@ -67,7 +67,7 @@ class VersionAnnotationPatch(Patch):
added = m.get('added', None)
deprecated = m.get('deprecated', None)
assert added or not f.added, f"Field {f.path} does not have an `added` annotation"
assert added or f.added, f"Field {f.path} does not have an `added` annotation"
# We do not allow the added and deprecated flags to be
# modified after the fact.