From 25b4249f540cc85b8b6c44ca17637548997f27b7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 8 Aug 2022 11:31:19 +0930 Subject: [PATCH] doc: fix decode schema for bolt11 routehints. I decode a routehint in the next patch, and it barfed: ``` > assert only_one(l1.rpc.decode(inv['bolt11'])['routes'])['short_channel_id'] == alias23 tests/test_opening.py:1515: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ contrib/pyln-client/pyln/client/lightning.py:321: in wrapper return self.call(name, payload=args) contrib/pyln-testing/pyln/testing/utils.py:691: in call schemas[1].validate(res) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Validator(schema={'$schema': 'http://json-...ft-07/schema#', 'allOf': [{'if': {'properties': {'type': {'enum': [...], ...iption': 'if this is f... diagnostics!', 'type': 'boolean'}}, 'required': ['type', 'valid'], ...}, format_checker=None) args = ({'amount_msat': 10msat, 'created_at': 1659923931, 'currency': 'bcrt', 'description': 'desc', ...},), kwargs = {} error = def validate(self, *args, **kwargs): for error in self.iter_errors(*args, **kwargs): > raise error E jsonschema.exceptions.ValidationError: 1msat is not of type 'u32' E E Failed validating 'type' in schema['allOf'][6]['then']['properties']['routes']['items']['items']['properties']['fee_base_msat']: E {'description': 'the base fee for payments', 'type': 'u32'} E E On instance['routes'][0][0]['fee_base_msat']: E 1msat ``` Signed-off-by: Rusty Russell --- doc/lightning-decode.7.md | 4 ++-- doc/schemas/decode.schema.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/lightning-decode.7.md b/doc/lightning-decode.7.md index 108aed713..078e45a12 100644 --- a/doc/lightning-decode.7.md +++ b/doc/lightning-decode.7.md @@ -156,7 +156,7 @@ If **type** is "bolt11 invoice", and **valid** is *true*: - hops in the route: - **pubkey** (pubkey): the public key of the node - **short_channel_id** (short_channel_id): a channel to the next peer - - **fee_base_msat** (u32): the base fee for payments + - **fee_base_msat** (msat): the base fee for payments - **fee_proportional_millionths** (u32): the parts-per-million fee for payments - **cltv_expiry_delta** (u32): the CLTV delta across this hop - **extra** (array of objects, optional): Any extra fields we didn't know how to parse: @@ -201,4 +201,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:a3963c3e0061b0d42a1f9e2f2a9012df780fce0264c6785f0311909b01f78af2) +[comment]: # ( SHA256STAMP:3e522a9788bb79302e4c4386c3937b7dcd8359d1b894364ac3e884bd3f695850) diff --git a/doc/schemas/decode.schema.json b/doc/schemas/decode.schema.json index 70d305460..66b86a4f2 100644 --- a/doc/schemas/decode.schema.json +++ b/doc/schemas/decode.schema.json @@ -869,7 +869,7 @@ "description": "a channel to the next peer" }, "fee_base_msat": { - "type": "u32", + "type": "msat", "description": "the base fee for payments" }, "fee_proportional_millionths": {