Skip to content

Commit 0aef52e

Browse files
authored
Lint docs (payjoin#426)
2 parents 41de968 + e1333ea commit 0aef52e

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

.github/ISSUE_TEMPLATE/minor-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ Tag and publish new release:
5656
- In the body of the tag message put a copy of the **Summary** and **Changelog** for the release.
5757
- Make sure the tag is signed, for extra safety use the explicit `--sign` flag.
5858
- [ ] Wait for the CI to finish one last time.
59-
- [ ] Push the new tag to the `payjoin/rust-payjoin` repo.
6059
- [ ] Build the docs locally to ensure they are building correctly.
60+
- [ ] Push the new tag to the `payjoin/rust-payjoin` repo.
6161
- [ ] Publish the crate in question crates to crates.io.
6262
- [ ] Create the release on GitHub.
6363
- Go to "tags", click on the dots on the right and select "Create Release".

.github/workflows/rust.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ jobs:
4949
uses: Swatinem/rust-cache@v2
5050
- name: "Install clippy"
5151
run: rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
52-
- name: "Run linting"
52+
- name: "Run code linting"
5353
run: bash contrib/lint.sh
54+
- name: "Run documentation linting"
55+
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --document-private-items
5456

5557
Coverage:
5658
name: Code coverage

payjoin/src/receive/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ impl WantsInputs {
518518
/// UIH1 and UIH2 according to the BlockSci practice
519519
/// BlockSci UIH1 and UIH2:
520520
/// if min(in) > min(out) then UIH1 else UIH2
521-
/// https://eprint.iacr.org/2022/589.pdf
521+
/// <https://eprint.iacr.org/2022/589.pdf>
522522
fn avoid_uih(
523523
&self,
524524
candidate_inputs: impl IntoIterator<Item = InputPair>,

payjoin/src/receive/v2/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl Receiver {
216216
/// The sender's original PSBT and optional parameters
217217
///
218218
/// This type is used to process the request. It is returned by
219-
/// [`UncheckedProposal::from_request()`](super::::UncheckedProposal::from_request()).
219+
/// [`Receiver::process_res()`].
220220
///
221221
/// If you are implementing an interactive payment processor, you should get extract the original
222222
/// transaction with extract_tx_to_schedule_broadcast() and schedule, followed by checking
@@ -393,7 +393,7 @@ impl WantsInputs {
393393
/// UIH1 and UIH2 according to the BlockSci practice
394394
/// BlockSci UIH1 and UIH2:
395395
/// if min(in) > min(out) then UIH1 else UIH2
396-
/// https://eprint.iacr.org/2022/589.pdf
396+
/// <https://eprint.iacr.org/2022/589.pdf>
397397
pub fn try_preserving_privacy(
398398
&self,
399399
candidate_inputs: impl IntoIterator<Item = InputPair>,

payjoin/src/send/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! 3. (optional) Spawn a thread or async task that will broadcast the original PSBT fallback after
1111
//! delay (e.g. 1 minute) unless canceled
1212
//! 4. Construct the [`Sender`] using [`SenderBuilder`] with the PSBT and payjoin uri
13-
//! 5. Send the request(s) and receive response(s) by following on the extracted [`Context`]
13+
//! 5. Send the request(s) and receive response(s) by following on the extracted Context
1414
//! 6. Sign and finalize the Payjoin Proposal PSBT
1515
//! 7. Broadcast the Payjoin Transaction (and cancel the optional fallback broadcast)
1616
//!
@@ -70,8 +70,8 @@ impl<'a> SenderBuilder<'a> {
7070
/// Prepare an HTTP request and request context to process the response
7171
///
7272
/// An HTTP client will own the Request data while Context sticks around so
73-
/// a `(Request, Context)` tuple is returned from `RequestBuilder::build()`
74-
/// to keep them separated.
73+
/// a `(Request, Context)` tuple is returned from [`SenderBuilder::build_recommended()`]
74+
/// (or other `build` methods) to keep them separated.
7575
pub fn from_psbt_and_uri(psbt: Psbt, uri: PjUri<'a>) -> Result<Self, CreateRequestError> {
7676
Ok(Self {
7777
psbt,
@@ -339,6 +339,10 @@ impl Sender {
339339
pub fn endpoint(&self) -> &Url { &self.endpoint }
340340
}
341341

342+
/// Data required to validate the response.
343+
///
344+
/// This type is used to process the response. Get it from [`Sender`]'s build methods.
345+
/// Then call [`Self::process_response`] on it to continue BIP78 flow.
342346
#[derive(Debug, Clone)]
343347
pub struct V1Context {
344348
psbt_context: PsbtContext,
@@ -451,10 +455,7 @@ impl V2GetContext {
451455
}
452456
}
453457

454-
/// Data required for validation of response.
455-
///
456-
/// This type is used to process the response. Get it from [`RequestBuilder`]'s build methods.
457-
/// Then you only need to call [`Self::process_response`] on it to continue BIP78 flow.
458+
/// Data required to validate the response against the original PSBT.
458459
#[derive(Debug, Clone)]
459460
pub struct PsbtContext {
460461
original_psbt: Psbt,

0 commit comments

Comments
 (0)