msggen: Add conversion from cln-rpc to cln-grpc for Option<Outpoint>

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`
This commit is contained in:
Christian Decker 2022-07-27 11:23:32 +02:00
parent 775d6ba193
commit b9a7f36ab3
3 changed files with 250 additions and 249 deletions

View file

@ -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
}

View file

@ -428,6 +428,7 @@ class GrpcUnconverterGenerator(GrpcConverterGenerator):
'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())',

File diff suppressed because one or more lines are too long