diff --git a/contrib/pyln-client/pyln/client/lightning.py b/contrib/pyln-client/pyln/client/lightning.py index 539e9e49c..51e70ae7e 100644 --- a/contrib/pyln-client/pyln/client/lightning.py +++ b/contrib/pyln-client/pyln/client/lightning.py @@ -453,11 +453,10 @@ class LightningRpc(UnixDomainSocketRpc): if isinstance(obj, dict): for k, v in obj.items(): if k.endswith('msat'): - if isinstance(v, str) and v.endswith('msat'): - obj[k] = Millisatoshi(v) - # Special case for array of msat values - elif isinstance(v, list) and all(isinstance(e, str) and e.endswith('msat') for e in v): + if isinstance(v, list): obj[k] = [Millisatoshi(e) for e in v] + else: + obj[k] = Millisatoshi(v) else: obj[k] = LightningRpc.LightningJSONDecoder.replace_amounts(v) elif isinstance(obj, list): diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py index 4cbb63ab0..d576a3aba 100644 --- a/contrib/pyln-testing/pyln/testing/fixtures.py +++ b/contrib/pyln-testing/pyln/testing/fixtures.py @@ -356,7 +356,7 @@ def _extra_validator(is_request: bool): return False def is_msat_response(checker, instance): - """String number ending in msat""" + """String number ending in msat (deprecated) or integer""" return type(instance) is Millisatoshi def is_txid(checker, instance): diff --git a/doc/lightning-decodepay.7.md b/doc/lightning-decodepay.7.md index 300d80451..699038985 100644 --- a/doc/lightning-decodepay.7.md +++ b/doc/lightning-decodepay.7.md @@ -38,7 +38,7 @@ On success, an object is returned, containing: - 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: @@ -70,4 +70,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:17cb6c66c75e907f3a2583d702aec2fc6e5a7b6026d05a3ed9957304799c9aef) +[comment]: # ( SHA256STAMP:a606b0d0594d48c619a8d34c7c0d0996982db10f1423841f269e89004a19fa98) diff --git a/doc/schemas/decodepay.schema.json b/doc/schemas/decodepay.schema.json index 0823f7afa..09fa334da 100644 --- a/doc/schemas/decodepay.schema.json +++ b/doc/schemas/decodepay.schema.json @@ -132,7 +132,7 @@ "description": "a channel to the next peer" }, "fee_base_msat": { - "type": "u32", + "type": "msat", "description": "the base fee for payments" }, "fee_proportional_millionths": {