Skip to content

Commit

Permalink
fix doc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Jan 10, 2025
1 parent 5051443 commit 5e41a5e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ coverage: coverage-run-unittests coverage-collect-data coverage-generate-report
.PHONY: gen-rpc-doc
gen-rpc-doc:
$(if $(shell command -v fiber-rpc-gen),,cargo install fiber-rpc-gen --force)
fiber-rpc-gen ./src/rpc
/Users/yukang/code/rpc-doc-gen/target/debug/fiber-rpc-gen ./src/
if grep -q "TODO: add desc" ./src/rpc/README.md; then \
echo "Warning: There are 'TODO: add desc' in src/rpc/README.md, please add documentation comments to resolve them"; \
exit 1; \
Expand Down
33 changes: 32 additions & 1 deletion src/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ You may refer to the e2e test cases in the `tests/bruno/e2e` directory for examp
* [Type `Channel`](#type-channel)
* [Type `ChannelInfo`](#type-channelinfo)
* [Type `ChannelState`](#type-channelstate)
* [Type `HopHint`](#type-hophint)
* [Type `NewInvoiceParams`](#type-newinvoiceparams)
* [Type `NodeInfo`](#type-nodeinfo)
* [Type `PaymentSessionStatus`](#type-paymentsessionstatus)
* [Type `RemoveTlcReason`](#type-removetlcreason)
Expand All @@ -60,7 +62,6 @@ You may refer to the e2e test cases in the `tests/bruno/e2e` directory for examp
<a id="cch"></a>
### Module `Cch`
RPC module for cross chain hub demonstration.
This is the seccond line


<a id="cch-send_btc"></a>
Expand Down Expand Up @@ -713,6 +714,24 @@ The Channel information.
* `chain_hash` - Hash256, The chain hash of the channel.
* `udt_type_script` - `Option<Script>`, The UDT type script of the channel.

<a id="#type-newinvoiceparams"></a>
### Type `NewInvoiceParams`

The parameter struct for generating a new invoice.


#### Fields

* `amount` - u128, The amount of the invoice.
* `description` - `Option<String>`, The description of the invoice.
* `currency` - Currency, The currency of the invoice.
* `payment_preimage` - Hash256, The payment preimage of the invoice.
* `expiry` - `Option<u64>`, The expiry time of the invoice.
* `fallback_address` - `Option<String>`, The fallback address of the invoice.
* `final_expiry_delta` - `Option<u64>`, The final HTLC timeout of the invoice.
* `udt_type_script` - `Option<Script>`, The UDT type script of the invoice.
* `hash_algorithm` - `Option<HashAlgorithm>`, The hash algorithm of the invoice.

<a id="#type-paymentsessionstatus"></a>
### Type `PaymentSessionStatus`

Expand All @@ -726,3 +745,15 @@ The status of a payment, will update as the payment progresses.
* `Success` - , related HTLC is successfully settled
* `Failed` - , related HTLC is failed

<a id="#type-hophint"></a>
### Type `HopHint`

A hop hint is a hint for a node to use a specific channel.


#### Fields

* `pubkey` - Pubkey, The public key of the node
* `channel_funding_tx` - Hash256, The funding transaction hash of the channel outpoint
* `inbound` - bool, inbound or outbound to use this channel

1 change: 0 additions & 1 deletion src/rpc/cch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ pub(crate) struct ReceiveBTCResponse {
}

/// RPC module for cross chain hub demonstration.
/// This is the seccond line
#[rpc(server)]
trait CchRpc {
/// Send BTC to a address.
Expand Down
1 change: 1 addition & 0 deletions src/rpc/invoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use serde_with::serde_as;
use std::time::Duration;
use tentacle::secio::SecioKeyPair;

/// The parameter struct for generating a new invoice.
#[serde_as]
#[derive(Serialize, Deserialize)]
pub(crate) struct NewInvoiceParams {
Expand Down
1 change: 1 addition & 0 deletions src/rpc/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ pub(crate) struct SendPaymentCommandParams {
dry_run: Option<bool>,
}

/// A hop hint is a hint for a node to use a specific channel.
#[serde_as]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct HopHint {
Expand Down

0 comments on commit 5e41a5e

Please sign in to comment.