Skip to content

Commit 939ddf2

Browse files
committed
fix: doc tests
1 parent 79d9dcb commit 939ddf2

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

src/client/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use std::path::PathBuf;
1818
/// key_id: "my-key-2024".to_string(),
1919
/// private_key_path: PathBuf::from("keys/private.pem"),
2020
/// jwks_path: Some(PathBuf::from("keys/jwks.json")),
21+
/// wallet_address_url: "https://rafiki.money/alice".into(),
2122
/// };
2223
/// ```
2324
#[derive(Debug, Clone, Serialize, Deserialize)]

src/client/core.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub trait BaseClient {
3131
/// private_key_path: "path/to/private-key.pem".into(),
3232
/// key_id: "my-key-id".to_string(),
3333
/// jwks_path: Some("path/to/jwks.json".into()),
34+
/// wallet_address_url: "https://rafiki.money/alice".into(),
3435
/// };
3536
///
3637
/// // This would fail in a real scenario if the files don't exist

src/client/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
//! private_key_path: "path/to/private-key.pem".into(),
3838
//! key_id: "my-key-id".to_string(),
3939
//! jwks_path: Some("path/to/jwks.json".into()),
40+
//! wallet_address_url: "https://rafiki.money/alice".into(),
4041
//! };
4142
//!
4243
//! // This would fail in a real scenario if the files don't exist
@@ -47,16 +48,15 @@
4748
//! let wallet_address = client.wallet_address().get("https://rafiki.money/alice").await?;
4849
//!
4950
//! // Example of how to request a grant
50-
//! let grant_request = GrantRequest {
51-
//! access_token: AccessTokenRequest {
51+
//! let grant_request = GrantRequest::new(
52+
//! AccessTokenRequest {
5253
//! access: vec![AccessItem::IncomingPayment {
5354
//! actions: vec![IncomingPaymentAction::Create, IncomingPaymentAction::Read],
5455
//! identifier: None,
5556
//! }],
5657
//! },
57-
//! client: "https://rafiki.money/alice".to_string(),
58-
//! interact: None,
59-
//! };
58+
//! None,
59+
//! );
6060
//!
6161
//! let access_token = client.grant().request(&wallet_address.auth_server, &grant_request).await?;
6262
//!

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//! private_key_path: "path/to/private-key.pem".into(),
2323
//! key_id: "my-key-id".to_string(),
2424
//! jwks_path: Some("path/to/jwks.json".into()),
25+
//! wallet_address_url: "https://rafiki.money/alice".into(),
2526
//! };
2627
//!
2728
//! // This would fail in a real scenario if the files don't exist
@@ -63,6 +64,7 @@
6364
//! private_key_path: "path/to/private-key.pem".into(),
6465
//! key_id: "my-key-id".to_string(),
6566
//! jwks_path: Some("path/to/jwks.json".into()),
67+
//! wallet_address_url: "https://rafiki.money/alice".into(),
6668
//! };
6769
//!
6870
//! // This would fail in a real scenario if the files don't exist

src/types/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,15 @@
3636
//! };
3737
//!
3838
//! // Create a grant request for incoming payment
39-
//! let grant_request = GrantRequest {
40-
//! access_token: AccessTokenRequest {
39+
//! let grant_request = GrantRequest::new(
40+
//! AccessTokenRequest {
4141
//! access: vec![AccessItem::IncomingPayment {
4242
//! actions: vec![IncomingPaymentAction::Create, IncomingPaymentAction::Read],
4343
//! identifier: None,
4444
//! }],
4545
//! },
46-
//! client: "https://rafiki.money/alice".to_string(),
47-
//! interact: None,
48-
//! };
46+
//! None,
47+
//! );
4948
//!
5049
//! // Create an incoming payment request
5150
//! let payment_request = CreateIncomingPaymentRequest {

0 commit comments

Comments
 (0)