From b53cc69cfd4c2cdc6be5e62fc8e706e1b8c43054 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 7 Apr 2023 14:08:05 +0930 Subject: [PATCH] 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 --- contrib/msggen/msggen/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/msggen/msggen/patch.py b/contrib/msggen/msggen/patch.py index d8b12ff2b..f25693bee 100644 --- a/contrib/msggen/msggen/patch.py +++ b/contrib/msggen/msggen/patch.py @@ -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.