schema: Fix wrong type of CLTV in route
We were using `number` instead of `u32` which caused it to be serialized to string with a decimal, which then would be rejected by lightningd. Changelog-Fixed: proto: Fixed a wrong number type being used in routes
This commit is contained in:
committed by
Rusty Russell
parent
5a4e6ec7e0
commit
990096f904
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -17,4 +17,4 @@ statements_gettextgen.po linguist-generated=true
|
||||
cln-grpc/proto/node.proto -text -diff linguist-generated=true
|
||||
cln-grpc/src/convert.rs -text -diff linguist-generated=true
|
||||
cln-rpc/src/model.rs -text -diff linguist-generated=true
|
||||
contrib/pyln-testing/pyln/testing/node_pb2.py linguist-generated=true
|
||||
contrib/pyln-testing/pyln/testing/node_pb2.py -text -diff linguist-generated=true
|
||||
|
||||
2
cln-grpc/proto/node.proto
generated
2
cln-grpc/proto/node.proto
generated
@@ -1533,7 +1533,7 @@ message GetrouteRequest {
|
||||
bytes id = 1;
|
||||
Amount amount_msat = 9;
|
||||
uint64 riskfactor = 3;
|
||||
optional double cltv = 4;
|
||||
optional uint32 cltv = 4;
|
||||
optional bytes fromid = 5;
|
||||
optional uint32 fuzzpercent = 6;
|
||||
repeated string exclude = 7;
|
||||
|
||||
4
cln-grpc/src/convert.rs
generated
4
cln-grpc/src/convert.rs
generated
@@ -2204,7 +2204,7 @@ impl From<requests::GetrouteRequest> for pb::GetrouteRequest {
|
||||
id: c.id.serialize().to_vec(), // Rule #2 for type pubkey
|
||||
amount_msat: Some(c.amount_msat.into()), // Rule #2 for type msat
|
||||
riskfactor: c.riskfactor, // Rule #2 for type u64
|
||||
cltv: c.cltv, // Rule #2 for type number?
|
||||
cltv: c.cltv, // Rule #2 for type u32?
|
||||
fromid: c.fromid.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey?
|
||||
fuzzpercent: c.fuzzpercent, // Rule #2 for type u32?
|
||||
// Field: GetRoute.exclude[]
|
||||
@@ -2892,7 +2892,7 @@ impl From<pb::GetrouteRequest> for requests::GetrouteRequest {
|
||||
id: PublicKey::from_slice(&c.id).unwrap(), // Rule #1 for type pubkey
|
||||
amount_msat: c.amount_msat.unwrap().into(), // Rule #1 for type msat
|
||||
riskfactor: c.riskfactor, // Rule #1 for type u64
|
||||
cltv: c.cltv, // Rule #1 for type number?
|
||||
cltv: c.cltv, // Rule #1 for type u32?
|
||||
fromid: c.fromid.map(|v| PublicKey::from_slice(&v).unwrap()), // Rule #1 for type pubkey?
|
||||
fuzzpercent: c.fuzzpercent, // Rule #1 for type u32?
|
||||
exclude: Some(c.exclude.into_iter().map(|s| s.into()).collect()), // Rule #4
|
||||
|
||||
2
cln-rpc/src/model.rs
generated
2
cln-rpc/src/model.rs
generated
@@ -1270,7 +1270,7 @@ pub mod requests {
|
||||
pub amount_msat: Amount,
|
||||
pub riskfactor: u64,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub cltv: Option<f64>,
|
||||
pub cltv: Option<u32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub fromid: Option<PublicKey>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -20,7 +20,7 @@
|
||||
"description": ""
|
||||
},
|
||||
"cltv": {
|
||||
"type": "number",
|
||||
"type": "u32",
|
||||
"description": ""
|
||||
},
|
||||
"fromid": {
|
||||
|
||||
Reference in New Issue
Block a user