Skip to content

Commit e5a1d93

Browse files
s373nZendothermicdev
authored andcommitted
msggen: Include AddPsbtOutput to RPC list and meta field map; regenerate libraries
1 parent 428b23c commit e5a1d93

File tree

11 files changed

+1135
-915
lines changed

11 files changed

+1135
-915
lines changed

.msggen.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,17 @@
496496
"AddgossipRequest": {
497497
"AddGossip.message": 1
498498
},
499+
"AddpsbtoutputRequest": {
500+
"AddPsbtOutput.destination": 4,
501+
"AddPsbtOutput.initialpsbt": 3,
502+
"AddPsbtOutput.locktime": 2,
503+
"AddPsbtOutput.satoshi": 1
504+
},
505+
"AddpsbtoutputResponse": {
506+
"AddPsbtOutput.estimated_added_weight": 2,
507+
"AddPsbtOutput.outnum": 3,
508+
"AddPsbtOutput.psbt": 1
509+
},
499510
"Autoclean-onceAutoclean": {
500511
"AutoClean-Once.autoclean.expiredinvoices": 6,
501512
"AutoClean-Once.autoclean.failedforwards": 2,
@@ -3323,6 +3334,38 @@
33233334
"added": "pre-v0.10.1",
33243335
"deprecated": false
33253336
},
3337+
"AddPsbtOutput": {
3338+
"added": "pre-v0.10.1",
3339+
"deprecated": false
3340+
},
3341+
"AddPsbtOutput.destination": {
3342+
"added": "pre-v0.10.1",
3343+
"deprecated": false
3344+
},
3345+
"AddPsbtOutput.estimated_added_weight": {
3346+
"added": "pre-v0.10.1",
3347+
"deprecated": false
3348+
},
3349+
"AddPsbtOutput.initialpsbt": {
3350+
"added": "pre-v0.10.1",
3351+
"deprecated": false
3352+
},
3353+
"AddPsbtOutput.locktime": {
3354+
"added": "pre-v0.10.1",
3355+
"deprecated": false
3356+
},
3357+
"AddPsbtOutput.outnum": {
3358+
"added": "pre-v0.10.1",
3359+
"deprecated": false
3360+
},
3361+
"AddPsbtOutput.psbt": {
3362+
"added": "pre-v0.10.1",
3363+
"deprecated": false
3364+
},
3365+
"AddPsbtOutput.satoshi": {
3366+
"added": "pre-v0.10.1",
3367+
"deprecated": false
3368+
},
33263369
"AutoClean-Once": {
33273370
"added": "pre-v0.10.1",
33283371
"deprecated": null

cln-grpc/proto/node.proto

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-grpc/src/convert.rs

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-grpc/src/server.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,38 @@ impl Node for Server
274274

275275
}
276276

277+
async fn add_psbt_output(
278+
&self,
279+
request: tonic::Request<pb::AddpsbtoutputRequest>,
280+
) -> Result<tonic::Response<pb::AddpsbtoutputResponse>, tonic::Status> {
281+
let req = request.into_inner();
282+
let req: requests::AddpsbtoutputRequest = req.into();
283+
debug!("Client asked for add_psbt_output");
284+
trace!("add_psbt_output request: {:?}", req);
285+
let mut rpc = ClnRpc::new(&self.rpc_path)
286+
.await
287+
.map_err(|e| Status::new(Code::Internal, e.to_string()))?;
288+
let result = rpc.call(Request::AddPsbtOutput(req))
289+
.await
290+
.map_err(|e| Status::new(
291+
Code::Unknown,
292+
format!("Error calling method AddPsbtOutput: {:?}", e)))?;
293+
match result {
294+
Response::AddPsbtOutput(r) => {
295+
trace!("add_psbt_output response: {:?}", r);
296+
Ok(tonic::Response::new(r.into()))
297+
},
298+
r => Err(Status::new(
299+
Code::Internal,
300+
format!(
301+
"Unexpected result {:?} to method call AddPsbtOutput",
302+
r
303+
)
304+
)),
305+
}
306+
307+
}
308+
277309
async fn auto_clean_invoice(
278310
&self,
279311
request: tonic::Request<pb::AutocleaninvoiceRequest>,

cln-rpc/src/model.rs

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/msggen/msggen/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
],
8080
"properties": {
8181
"satoshi": {
82-
"type": "sat",
82+
"type": "msat",
8383
"description": [
8484
"The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*."
8585
]

contrib/msggen/msggen/utils/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,16 @@ def load_notification(name, typename: TypeName):
8989

9090

9191
def load_jsonrpc_service():
92+
# FIXME: Maybe this list should be located somewhere other than utils so
93+
# it's more intuitive to remember to update when new RPC calls are added?
9294
method_names = [
9395
"Getinfo",
9496
"ListPeers",
9597
"ListFunds",
9698
"SendPay",
9799
"ListChannels",
98100
"AddGossip",
101+
"AddPsbtOutput",
99102
"AutoCleanInvoice",
100103
"AutoClean-Once",
101104
"AutoClean-Status",

contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Lines changed: 917 additions & 913 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/pyln-grpc-proto/pyln/grpc/node_pb2_grpc.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ def __init__(self, channel):
4444
request_serializer=node__pb2.AddgossipRequest.SerializeToString,
4545
response_deserializer=node__pb2.AddgossipResponse.FromString,
4646
)
47+
self.AddPsbtOutput = channel.unary_unary(
48+
'/cln.Node/AddPsbtOutput',
49+
request_serializer=node__pb2.AddpsbtoutputRequest.SerializeToString,
50+
response_deserializer=node__pb2.AddpsbtoutputResponse.FromString,
51+
)
4752
self.AutoCleanInvoice = channel.unary_unary(
4853
'/cln.Node/AutoCleanInvoice',
4954
request_serializer=node__pb2.AutocleaninvoiceRequest.SerializeToString,
@@ -640,6 +645,12 @@ def AddGossip(self, request, context):
640645
context.set_details('Method not implemented!')
641646
raise NotImplementedError('Method not implemented!')
642647

648+
def AddPsbtOutput(self, request, context):
649+
"""Missing associated documentation comment in .proto file."""
650+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
651+
context.set_details('Method not implemented!')
652+
raise NotImplementedError('Method not implemented!')
653+
643654
def AutoCleanInvoice(self, request, context):
644655
"""Missing associated documentation comment in .proto file."""
645656
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
@@ -1339,6 +1350,11 @@ def add_NodeServicer_to_server(servicer, server):
13391350
request_deserializer=node__pb2.AddgossipRequest.FromString,
13401351
response_serializer=node__pb2.AddgossipResponse.SerializeToString,
13411352
),
1353+
'AddPsbtOutput': grpc.unary_unary_rpc_method_handler(
1354+
servicer.AddPsbtOutput,
1355+
request_deserializer=node__pb2.AddpsbtoutputRequest.FromString,
1356+
response_serializer=node__pb2.AddpsbtoutputResponse.SerializeToString,
1357+
),
13421358
'AutoCleanInvoice': grpc.unary_unary_rpc_method_handler(
13431359
servicer.AutoCleanInvoice,
13441360
request_deserializer=node__pb2.AutocleaninvoiceRequest.FromString,
@@ -2006,6 +2022,23 @@ def AddGossip(request,
20062022
options, channel_credentials,
20072023
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
20082024

2025+
@staticmethod
2026+
def AddPsbtOutput(request,
2027+
target,
2028+
options=(),
2029+
channel_credentials=None,
2030+
call_credentials=None,
2031+
insecure=False,
2032+
compression=None,
2033+
wait_for_ready=None,
2034+
timeout=None,
2035+
metadata=None):
2036+
return grpc.experimental.unary_unary(request, target, '/cln.Node/AddPsbtOutput',
2037+
node__pb2.AddpsbtoutputRequest.SerializeToString,
2038+
node__pb2.AddpsbtoutputResponse.FromString,
2039+
options, channel_credentials,
2040+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
2041+
20092042
@staticmethod
20102043
def AutoCleanInvoice(request,
20112044
target,

contrib/pyln-testing/pyln/testing/grpc2py.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ def addgossip2py(m):
186186
})
187187

188188

189+
def addpsbtoutput2py(m):
190+
return remove_default({
191+
"estimated_added_weight": m.estimated_added_weight, # PrimitiveField in generate_composite
192+
"outnum": m.outnum, # PrimitiveField in generate_composite
193+
"psbt": m.psbt, # PrimitiveField in generate_composite
194+
})
195+
196+
189197
def autocleaninvoice2py(m):
190198
return remove_default({
191199
"cycle_seconds": m.cycle_seconds, # PrimitiveField in generate_composite

0 commit comments

Comments
 (0)