Skip to content

Commit 166a2cd

Browse files
committed
requested changes
1 parent a0adce2 commit 166a2cd

File tree

4 files changed

+35
-17
lines changed

4 files changed

+35
-17
lines changed

primitives/examples/accounting_response.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ fn main() {
1616
// earners sum and spenders sum should always match since balances are CheckedState
1717
let json = json!({
1818
"earners": {
19-
"0x0000000000000000000000000000000000000000": "10000000000",
20-
"0x1111111111111111111111111111111111111111": "20000000000",
21-
"0x2222222222222222222222222222222222222222": "30000000000",
19+
"0x80690751969B234697e9059e04ed72195c3507fa": "10000000000",
20+
"0xf3f583AEC5f7C030722Fe992A5688557e1B86ef7": "20000000000",
21+
"0xE882ebF439207a70dDcCb39E13CA8506c9F45fD9": "30000000000",
2222
},
2323
"spenders": {
24-
"0x7777777777777777777777777777777777777777": "60000000000",
24+
"0xaCBaDA2d5830d1875ae3D2de207A1363B316Df2F": "60000000000",
2525
},
2626
});
2727
assert!(from_value::<AccountingResponse::<CheckedState>>(json).is_ok());

primitives/examples/all_spenders_response.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use serde_json::{from_value, json};
44
fn main() {
55
let json = json!({
66
"spenders": {
7-
"0x0000000000000000000000000000000000000000": {
7+
"0xaCBaDA2d5830d1875ae3D2de207A1363B316Df2F": {
88
"totalDeposited": "10000000000",
99
"totalSpent": "100000000",
1010
},
11-
"0x1111111111111111111111111111111111111111": {
11+
"0xDd589B43793934EF6Ad266067A0d1D4896b0dff0": {
1212
"totalDeposited": "90000000000",
1313
"totalSpent": "20000000000",
1414
},
15-
"0x2222222222222222222222222222222222222222": {
15+
"0x541b401362Ea1D489D322579552B099e801F3632": {
1616
"totalDeposited": "1000000000",
1717
"totalSpent": "1000000000",
1818
},

primitives/src/sentry.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ pub use event::{Event, EventType, CLICK, IMPRESSION};
2323
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
2424
#[serde(rename_all = "camelCase")]
2525
/// Channel Accounting response
26+
///
2627
/// A collection of all `Accounting`s for a specific [`Channel`](`crate::Channel`)
2728
///
2829
/// # Examples
2930
///
3031
/// ```
31-
#[doc = include_str!("../examples/validator_messages_create_request.rs")]
32+
#[doc = include_str!("../examples/accounting_response.rs")]
3233
/// ```
3334
pub struct AccountingResponse<S: BalancesState> {
3435
#[serde(flatten, bound = "S: BalancesState")]
@@ -633,7 +634,7 @@ pub struct SuccessResponse {
633634
pub success: bool,
634635
}
635636

636-
/// Spender limits for a spender on a `Channel`
637+
/// Spender limits for a spender on a `Channel`.
637638
///
638639
/// # Examples
639640
///
@@ -646,7 +647,7 @@ pub struct SpenderResponse {
646647
pub spender: Spender,
647648
}
648649

649-
/// Spender limits for all spenders on a `Channel`
650+
/// Spender limits for all spenders on a `Channel`.
650651
///
651652
/// # Examples
652653
///
@@ -668,7 +669,7 @@ pub struct AllSpendersQuery {
668669
pub page: u64,
669670
}
670671

671-
/// Includes all the payouts that need to be done for that channel
672+
/// Payouts to be performed for the given [`Channel`](`crate::Channel`).
672673
///
673674
/// # Examples
674675
///
@@ -693,7 +694,7 @@ pub struct ValidatorMessagesListResponse {
693694
pub messages: Vec<ValidatorMessage>,
694695
}
695696

696-
/// Contains all the different validator messages to be inserted
697+
/// Contains all the different validator messages to be created.
697698
///
698699
/// # Examples
699700
///

sentry/src/routes.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
//!
6464
//! The route is handled by [`channel::get_accounting_for_channel()`].
6565
//!
66+
//! Response: [`AccountingResponse`]
67+
//!
68+
//! ##### Examples
69+
//!
6670
//! Response:
6771
//!
6872
//! ```
@@ -78,6 +82,10 @@
7882
//!
7983
//! The route is handled by [`channel::get_spender_limits()`].
8084
//!
85+
//! Response: [`SpenderResponse`]
86+
//!
87+
//! ##### Examples
88+
//!
8189
//! Response:
8290
//!
8391
//! ```
@@ -100,6 +108,10 @@
100108
//!
101109
//! The route is handled by [`channel::get_all_spender_limits()`].
102110
//!
111+
//! Response: [`AllSpendersResponse`]
112+
//!
113+
//! ##### Examples
114+
//!
103115
//! Response:
104116
//!
105117
//! ```
@@ -164,9 +176,6 @@
164176
//! ```
165177
#![doc = include_str!("../../primitives/examples/validator_messages_create_request.rs")]
166178
//! ```
167-
//! Response: [`SuccessResponse`]
168-
//!
169-
//! Validator messages: [`MessageTypes`]
170179
//!
171180
//! #### GET `/v5/channel/:id/last-approved`
172181
//!
@@ -215,12 +224,17 @@
215224
//!
216225
//! The route is handled by [`channel::channel_payout()`].
217226
//!
218-
//! Request JSON body:
227+
//! Request JSON body: [`ChannelPayRequest`]
228+
//!
229+
//! Response: [`SuccessResponse`](primitives::sentry::SuccessResponse)
230+
//!
231+
//! ##### Examples
232+
//!
233+
//! Request (json):
219234
//!
220235
//! ```
221236
#![doc = include_str!("../../primitives/examples/channel_pay_request.rs")]
222237
//! ```
223-
//! Response: [`SuccessResponse`](primitives::sentry::SuccessResponse)
224238
//!
225239
//!
226240
//! #### GET `/v5/channel/:id/get-leaf`
@@ -450,6 +464,7 @@
450464
//! [`ApproveState`]: primitives::validator::ApproveState
451465
//! [`Accounting`]: crate::db::accounting::Accounting
452466
//! [`AccountingResponse`]: primitives::sentry::AccountingResponse
467+
//! [`AllSpendersResponse`]: primitives::sentry::AllSpendersResponse
453468
//! [`AnalyticsResponse`]: primitives::sentry::AnalyticsResponse
454469
//! [`AnalyticsQuery`]: primitives::analytics::AnalyticsQuery
455470
//! [`Auth.uid`]: crate::Auth::uid
@@ -461,12 +476,14 @@
461476
//! [`Channel.leader`]: primitives::Channel::leader
462477
//! [`Channel.follower`]: primitives::Channel::follower
463478
//! [`ChannelId`]: primitives::ChannelId
479+
//! [`ChannelPayRequest`]: primitives::sentry::ChannelPayRequest
464480
//! [`check_access()`]: crate::access::check_access
465481
//! [`Config.msgs_find_limit`]: primitives::Config::msgs_find_limit
466482
//! [`Event`]: primitives::sentry::Event
467483
//! [`Heartbeat`]: primitives::validator::Heartbeat
468484
//! [`MessageTypes`]: primitives::validator::MessageTypes
469485
//! [`NewState`]: primitives::validator::NewState
486+
//! [`SpenderResponse`]: primitives::sentry::SpenderResponse
470487
//! [`SuccessResponse`]: primitives::sentry::SuccessResponse
471488
//! [`ValidatorId`]: primitives::ValidatorId
472489

0 commit comments

Comments
 (0)