Ping request types are changed from number to u16

This commit is contained in:
Justin Litchfield
2023-01-08 22:02:56 -06:00
committed by Christian Decker
parent 85ce78f738
commit 879db694e1
6 changed files with 10 additions and 10 deletions

View File

@@ -1290,8 +1290,8 @@ message ListpaysPays {
message PingRequest {
bytes id = 1;
optional double len = 2;
optional double pongbytes = 3;
optional uint32 len = 2;
optional uint32 pongbytes = 3;
}
message PingResponse {

View File

@@ -1669,8 +1669,8 @@ impl From<pb::PingRequest> for requests::PingRequest {
fn from(c: pb::PingRequest) -> Self {
Self {
id: PublicKey::from_slice(&c.id).unwrap(), // Rule #1 for type pubkey
len: c.len, // Rule #1 for type number?
pongbytes: c.pongbytes, // Rule #1 for type number?
len: c.len.map(|v| v as u16), // Rule #1 for type u16?
pongbytes: c.pongbytes.map(|v| v as u16), // Rule #1 for type u16?
}
}
}

4
cln-rpc/src/model.rs generated
View File

@@ -1261,9 +1261,9 @@ pub mod requests {
#[serde(alias = "id")]
pub id: PublicKey,
#[serde(alias = "len", skip_serializing_if = "Option::is_none")]
pub len: Option<f64>,
pub len: Option<u16>,
#[serde(alias = "pongbytes", skip_serializing_if = "Option::is_none")]
pub pongbytes: Option<f64>,
pub pongbytes: Option<u16>,
}
impl From<PingRequest> for Request {

File diff suppressed because one or more lines are too long

View File

@@ -220,4 +220,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:862a1d319a30cb4a0e851d0d57b62eef78d7b7e35f76c70c6bc71d4d2f270a94)
[comment]: # ( SHA256STAMP:4a72e74f8551a9ded7ad9a23044198c985530b72d9a8974bb4ef68b3ee37b8da)

View File

@@ -10,10 +10,10 @@
"type": "pubkey"
},
"len": {
"type": "number"
"type": "u16"
},
"pongbytes": {
"type": "number"
"type": "u16"
}
}
}