invoicesrpc: format invoices.proto and remove json_name fields

We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
This commit is contained in:
Oliver Gugger committed 2020-03-07 11:23:07 +01:00
1 parent 23f5472cd3
commit 5a6fea31d9
2 files changed
+63 -60

No files matched your search

+22 -20
View File
@@ -22,26 +22,27 @@ service Invoices {
canceled, this call will succeed. If the invoice is already settled, it will
fail.
*/
rpc CancelInvoice(CancelInvoiceMsg) returns (CancelInvoiceResp);
rpc CancelInvoice (CancelInvoiceMsg) returns (CancelInvoiceResp);
/**
AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
supplied in the request.
*/
rpc AddHoldInvoice(AddHoldInvoiceRequest) returns (AddHoldInvoiceResp);
rpc AddHoldInvoice (AddHoldInvoiceRequest) returns (AddHoldInvoiceResp);
/**
SettleInvoice settles an accepted invoice. If the invoice is already
settled, this call will succeed.
*/
rpc SettleInvoice(SettleInvoiceMsg) returns (SettleInvoiceResp);
rpc SettleInvoice (SettleInvoiceMsg) returns (SettleInvoiceResp);
}
message CancelInvoiceMsg {
/// Hash corresponding to the (hold) invoice to cancel.
bytes payment_hash = 1;
}
message CancelInvoiceResp {}
}
message CancelInvoiceResp {
}
message AddHoldInvoiceRequest {
/**
@@ -50,49 +51,49 @@ message AddHoldInvoiceRequest {
field of the encoded payment request if the description_hash field is not
being used.
*/
string memo = 1 [json_name = "memo"];
string memo = 1;
/// The hash of the preimage
bytes hash = 2 [json_name = "hash"];
bytes hash = 2;
/**
The value of this invoice in satoshis
The fields value and value_msat are mutually exclusive.
*/
int64 value = 3 [json_name = "value"];
int64 value = 3;
/**
The value of this invoice in millisatoshis
The fields value and value_msat are mutually exclusive.
*/
int64 value_msat = 10 [json_name = "value_msat"];
int64 value_msat = 10;
/**
Hash (SHA-256) of a description of the payment. Used if the description of
payment (memo) is too long to naturally fit within the description field
of an encoded payment request.
*/
bytes description_hash = 4 [json_name = "description_hash"];
bytes description_hash = 4;
/// Payment request expiry time in seconds. Default is 3600 (1 hour).
int64 expiry = 5 [json_name = "expiry"];
int64 expiry = 5;
/// Fallback on-chain address.
string fallback_addr = 6 [json_name = "fallback_addr"];
string fallback_addr = 6;
/// Delta to use for the time-lock of the CLTV extended to the final hop.
uint64 cltv_expiry = 7 [json_name = "cltv_expiry"];
uint64 cltv_expiry = 7;
/**
Route hints that can each be individually used to assist in reaching the
invoice's destination.
*/
repeated lnrpc.RouteHint route_hints = 8 [json_name = "route_hints"];
repeated lnrpc.RouteHint route_hints = 8;
/// Whether this invoice should include routing hints for private channels.
bool private = 9 [json_name = "private"];
bool private = 9;
}
message AddHoldInvoiceResp {
@@ -101,19 +102,20 @@ message AddHoldInvoiceResp {
details of the invoice, the sender has all the data necessary to send a
payment to the recipient.
*/
string payment_request = 1 [json_name = "payment_request"];
string payment_request = 1;
}
message SettleInvoiceMsg {
/// Externally discovered pre-image that should be used to settle the hold invoice.
bytes preimage = 1;
}
}
message SettleInvoiceResp {}
message SettleInvoiceResp {
}
message SubscribeSingleInvoiceRequest {
reserved 1;
/// Hash corresponding to the (hold) invoice to subscribe to.
bytes r_hash = 2 [json_name = "r_hash"];
bytes r_hash = 2;
}