mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
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 = <ValidationError: "1msat is not of type 'u32'">
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 <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
016ce2b925
commit
25b4249f54
@@ -156,7 +156,7 @@ If **type** is "bolt11 invoice", and **valid** is *true*:
|
|||||||
- hops in the route:
|
- hops in the route:
|
||||||
- **pubkey** (pubkey): the public key of the node
|
- **pubkey** (pubkey): the public key of the node
|
||||||
- **short_channel_id** (short_channel_id): a channel to the next peer
|
- **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
|
- **fee_proportional_millionths** (u32): the parts-per-million fee for payments
|
||||||
- **cltv_expiry_delta** (u32): the CLTV delta across this hop
|
- **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:
|
- **extra** (array of objects, optional): Any extra fields we didn't know how to parse:
|
||||||
@@ -201,4 +201,4 @@ RESOURCES
|
|||||||
|
|
||||||
Main web site: <https://github.com/ElementsProject/lightning>
|
Main web site: <https://github.com/ElementsProject/lightning>
|
||||||
|
|
||||||
[comment]: # ( SHA256STAMP:a3963c3e0061b0d42a1f9e2f2a9012df780fce0264c6785f0311909b01f78af2)
|
[comment]: # ( SHA256STAMP:3e522a9788bb79302e4c4386c3937b7dcd8359d1b894364ac3e884bd3f695850)
|
||||||
|
|||||||
@@ -869,7 +869,7 @@
|
|||||||
"description": "a channel to the next peer"
|
"description": "a channel to the next peer"
|
||||||
},
|
},
|
||||||
"fee_base_msat": {
|
"fee_base_msat": {
|
||||||
"type": "u32",
|
"type": "msat",
|
||||||
"description": "the base fee for payments"
|
"description": "the base fee for payments"
|
||||||
},
|
},
|
||||||
"fee_proportional_millionths": {
|
"fee_proportional_millionths": {
|
||||||
|
|||||||
Reference in New Issue
Block a user