Skip to content

Commit

Permalink
msggen: Add conversion from cln-rpc to cln-grpc for Option<Outpoint>
Browse files Browse the repository at this point in the history
We didn't have optional Outpoints as arguments so far, so let's
backfill that.

Changelog-Changed: cln-rpc: The `wrong_funding` argument for `close` was changed from `bytes` to `outpoint`
  • Loading branch information
cdecker committed Sep 21, 2022
1 parent 58d7b61 commit d971c6b
Show file tree
Hide file tree
Showing 3 changed files with 250 additions and 249 deletions.
2 changes: 1 addition & 1 deletion cln-grpc/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ impl From<&pb::CloseRequest> for requests::CloseRequest {
unilateraltimeout: c.unilateraltimeout.clone(), // Rule #1 for type u32?
destination: c.destination.clone(), // Rule #1 for type string?
fee_negotiation_step: c.fee_negotiation_step.clone(), // Rule #1 for type string?
wrong_funding: c.wrong_funding.clone(), // Rule #1 for type outpoint?
wrong_funding: c.wrong_funding.as_ref().map(|a| a.into()), // Rule #1 for type outpoint?
force_lease_closed: c.force_lease_closed.clone(), // Rule #1 for type boolean?
feerange: Some(c.feerange.iter().map(|s| s.into()).collect()), // Rule #4
}
Expand Down
1 change: 1 addition & 0 deletions contrib/msggen/msggen/gen/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def generate_composite(self, prefix, field: CompositeField) -> None:
'msat_or_any?': f'c.{name}.as_ref().map(|a| a.into())',
'feerate': f'c.{name}.as_ref().unwrap().into()',
'feerate?': f'c.{name}.as_ref().map(|a| a.into())',
'outpoint?': f'c.{name}.as_ref().map(|a| a.into())',
'RoutehintList?': f'c.{name}.clone().map(|rl| rl.into())',
'short_channel_id': f'cln_rpc::primitives::ShortChannelId::from_str(&c.{name}).unwrap()',
'short_channel_id?': f'c.{name}.as_ref().map(|v| cln_rpc::primitives::ShortChannelId::from_str(&v).unwrap())',
Expand Down
496 changes: 248 additions & 248 deletions contrib/pyln-testing/pyln/testing/node_pb2.py

Large diffs are not rendered by default.

0 comments on commit d971c6b

Please sign in to comment.