Skip to content

Commit

Permalink
msggen: Regenerate for addition of SignInvoice
Browse files Browse the repository at this point in the history
Performed using:
  PYTHONPATH=contrib/msggen python3 contrib/msggen/msggen/__main__.py
  • Loading branch information
dongcarl authored and endothermicdev committed Feb 6, 2023
1 parent 11227d3 commit dc4ae9d
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,12 @@
"SetchannelResponse": {
"SetChannel.channels[]": 1
},
"SigninvoiceRequest": {
"SignInvoice.invstring": 1
},
"SigninvoiceResponse": {
"SignInvoice.bolt11": 1
},
"SignmessageRequest": {
"SignMessage.message": 1
},
Expand Down
9 changes: 9 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.

18 changes: 18 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 @@ -1466,6 +1466,38 @@ async fn set_channel(

}

async fn sign_invoice(
&self,
request: tonic::Request<pb::SigninvoiceRequest>,
) -> Result<tonic::Response<pb::SigninvoiceResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::SigninvoiceRequest = req.into();
debug!("Client asked for sign_invoice");
trace!("sign_invoice 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::SignInvoice(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method SignInvoice: {:?}", e)))?;
match result {
Response::SignInvoice(r) => {
trace!("sign_invoice response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call SignInvoice",
r
)
)),
}

}

async fn sign_message(
&self,
request: tonic::Request<pb::SignmessageRequest>,
Expand Down
33 changes: 33 additions & 0 deletions cln-rpc/src/model.rs

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

6 changes: 6 additions & 0 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,12 @@ def setchannel2py(m):
})


def signinvoice2py(m):
return remove_default({
"bolt11": m.bolt11, # PrimitiveField in generate_composite
})


def signmessage2py(m):
return remove_default({
"signature": hexlify(m.signature), # PrimitiveField in generate_composite
Expand Down

0 comments on commit dc4ae9d

Please sign in to comment.