@@ -308,6 +308,8 @@ pub mod messages {
308
308
}
309
309
}
310
310
311
+ /// Generated by the follower when a [`NewState`]
312
+ /// is generated by the leader and the state is signable and correct.
311
313
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , Eq ) ]
312
314
#[ serde( rename_all = "camelCase" ) ]
313
315
pub struct ApproveState {
@@ -316,6 +318,8 @@ pub mod messages {
316
318
pub is_healthy : bool ,
317
319
}
318
320
321
+ /// Generated by the [`Channel.leader`](crate::Channel::leader)
322
+ /// on changed balances for the [`Channel`](crate::Channel).
319
323
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , Eq ) ]
320
324
#[ serde( rename_all = "camelCase" ) ]
321
325
pub struct NewState < S : BalancesState > {
@@ -335,6 +339,18 @@ pub mod messages {
335
339
}
336
340
}
337
341
342
+ /// Generated by the [`Channel.follower`] on:
343
+ ///
344
+ /// - Payout mismatch in the [`NewState`] between earner & spenders (i.e. their sum is not equal)
345
+ /// - Invalid [`NewState`] root hash.
346
+ /// - Failed verification of the expected signer ([`Channel.leader`])
347
+ /// with the proposed [`NewState`] signature and state root.
348
+ /// - Invalid state transition (balances should always go up)
349
+ /// - [`NewState`] is unsignable because the health is below the [`Config.health_unsignable_promilles`]
350
+ ///
351
+ /// [`Channel.follower`]: crate::Channel::follower
352
+ /// [`Channel.leader`]: crate::Channel::leader
353
+ /// [`Config.health_unsignable_promilles`]: crate::Config::health_unsignable_promilles
338
354
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , Eq ) ]
339
355
#[ serde( rename_all = "camelCase" ) ]
340
356
pub struct RejectState < S : BalancesState > {
@@ -347,6 +363,13 @@ pub mod messages {
347
363
pub timestamp : DateTime < Utc > ,
348
364
}
349
365
366
+ /// Heartbeat sent to each [`Channel`] validator by the
367
+ /// other validator of the [`Channel`].
368
+ ///
369
+ /// The Heartbeat is sent on regular intervals every [`Config.heartbeat_time`].
370
+ ///
371
+ /// [`Channel`]: crate::Channel
372
+ /// [`Config.heartbeat_time`]: crate::Config::heartbeat_time
350
373
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , Eq ) ]
351
374
#[ serde( rename_all = "camelCase" ) ]
352
375
pub struct Heartbeat {
@@ -365,6 +388,7 @@ pub mod messages {
365
388
}
366
389
}
367
390
391
+ /// The message types used by validator.
368
392
#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , Eq ) ]
369
393
#[ serde( tag = "type" ) ]
370
394
pub enum MessageTypes {
0 commit comments