-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move
BeaconToSign
to entities module in signer
- Loading branch information
Showing
7 changed files
with
46 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use chrono::{DateTime, Utc}; | ||
|
||
use mithril_common::entities::{Epoch, SignedEntityType}; | ||
|
||
/// Beacon to sign | ||
#[derive(Debug, Clone, PartialEq)] | ||
pub struct BeaconToSign { | ||
/// The epoch when the beacon was issued | ||
pub epoch: Epoch, | ||
|
||
/// The signed entity type to sign | ||
pub signed_entity_type: SignedEntityType, | ||
|
||
/// Datetime when the beacon was initiated | ||
pub initiated_at: DateTime<Utc>, | ||
} | ||
|
||
impl BeaconToSign { | ||
/// Create a new `BeaconToSign` | ||
pub fn new( | ||
epoch: Epoch, | ||
signed_entity_type: SignedEntityType, | ||
initiated_at: DateTime<Utc>, | ||
) -> Self { | ||
Self { | ||
epoch, | ||
signed_entity_type, | ||
initiated_at, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters