Skip to content

Commit

Permalink
msggen: add funderupdate method
Browse files Browse the repository at this point in the history
Changelog-None
  • Loading branch information
daywalker90 authored and cdecker committed May 16, 2024
1 parent d288932 commit 6a68ef9
Show file tree
Hide file tree
Showing 11 changed files with 788 additions and 294 deletions.
114 changes: 114 additions & 0 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
"perkb": 0,
"perkw": 1
},
"FunderupdatePolicy": {
"available": 1,
"fixed": 2,
"match": 0
},
"GetinfoAddressType": {
"dns": 0,
"ipv4": 1,
Expand Down Expand Up @@ -1233,6 +1238,43 @@
"FundChannel_Start.scriptpubkey": 2,
"FundChannel_Start.warning_usage": 5
},
"FunderupdateRequest": {
"FunderUpdate.channel_fee_max_base_msat": 14,
"FunderUpdate.channel_fee_max_proportional_thousandths": 15,
"FunderUpdate.compact_lease": 16,
"FunderUpdate.fund_probability": 10,
"FunderUpdate.funding_weight": 13,
"FunderUpdate.fuzz_percent": 9,
"FunderUpdate.lease_fee_base_msat": 11,
"FunderUpdate.lease_fee_basis": 12,
"FunderUpdate.leases_only": 3,
"FunderUpdate.max_their_funding_msat": 5,
"FunderUpdate.min_their_funding_msat": 4,
"FunderUpdate.per_channel_max_msat": 7,
"FunderUpdate.per_channel_min_msat": 6,
"FunderUpdate.policy": 1,
"FunderUpdate.policy_mod": 2,
"FunderUpdate.reserve_tank_msat": 8
},
"FunderupdateResponse": {
"FunderUpdate.channel_fee_max_base_msat": 15,
"FunderUpdate.channel_fee_max_proportional_thousandths": 16,
"FunderUpdate.compact_lease": 17,
"FunderUpdate.fund_probability": 11,
"FunderUpdate.funding_weight": 14,
"FunderUpdate.fuzz_percent": 10,
"FunderUpdate.lease_fee_base_msat": 12,
"FunderUpdate.lease_fee_basis": 13,
"FunderUpdate.leases_only": 4,
"FunderUpdate.max_their_funding_msat": 6,
"FunderUpdate.min_their_funding_msat": 5,
"FunderUpdate.per_channel_max_msat": 8,
"FunderUpdate.per_channel_min_msat": 7,
"FunderUpdate.policy": 2,
"FunderUpdate.policy_mod": 3,
"FunderUpdate.reserve_tank_msat": 9,
"FunderUpdate.summary": 1
},
"FundpsbtRequest": {
"FundPsbt.excess_as_change": 8,
"FundPsbt.feerate": 2,
Expand Down Expand Up @@ -5025,6 +5067,78 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate": {
"added": "pre-v0.10.1",
"deprecated": null
},
"FunderUpdate.channel_fee_max_base_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.channel_fee_max_proportional_thousandths": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.compact_lease": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.fund_probability": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.funding_weight": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.fuzz_percent": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.lease_fee_base_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.lease_fee_basis": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.leases_only": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.max_their_funding_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.min_their_funding_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.per_channel_max_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.per_channel_min_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.policy": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.policy_mod": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.reserve_tank_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"FunderUpdate.summary": {
"added": "pre-v0.10.1",
"deprecated": false
},
"GetLog": {
"added": "pre-v0.10.1",
"deprecated": null
Expand Down
52 changes: 52 additions & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions cln-grpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,38 @@ impl Node for Server

}

async fn funder_update(
&self,
request: tonic::Request<pb::FunderupdateRequest>,
) -> Result<tonic::Response<pb::FunderupdateResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::FunderupdateRequest = req.into();
debug!("Client asked for funder_update");
trace!("funder_update request: {:?}", req);
let mut rpc = ClnRpc::new(&self.rpc_path)
.await
.map_err(|e| Status::new(Code::Internal, e.to_string()))?;
let result = rpc.call(Request::FunderUpdate(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method FunderUpdate: {:?}", e)))?;
match result {
Response::FunderUpdate(r) => {
trace!("funder_update response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call FunderUpdate",
r
)
)),
}

}

async fn get_route(
&self,
request: tonic::Request<pb::GetrouteRequest>,
Expand Down
Loading

0 comments on commit 6a68ef9

Please sign in to comment.