-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #885 from input-output-hk/jpraynaud/851-signable-a…
…rtifact-builder-mithril-stake-distribution-signer Mithril Stake Distribution Signable builder
- Loading branch information
Showing
16 changed files
with
100 additions
and
102 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
68 changes: 0 additions & 68 deletions
68
mithril-aggregator/src/signable_builder/mithril_stake_distribution.rs
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
//! The module used for building signables | ||
mod mithril_stake_distribution; | ||
mod signable_builder_service; | ||
|
||
pub use mithril_stake_distribution::*; | ||
pub use signable_builder_service::*; |
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
36 changes: 36 additions & 0 deletions
36
mithril-common/src/signable_builder/mithril_stake_distribution.rs
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,36 @@ | ||
use async_trait::async_trait; | ||
|
||
use crate::{ | ||
entities::{Epoch, ProtocolMessage}, | ||
signable_builder::SignableBuilder, | ||
StdResult, | ||
}; | ||
|
||
/// A [MithrilStakeDistributionSignableBuilder] builder | ||
#[derive(Default)] | ||
pub struct MithrilStakeDistributionSignableBuilder {} | ||
|
||
#[async_trait] | ||
impl SignableBuilder<Epoch, ProtocolMessage> for MithrilStakeDistributionSignableBuilder { | ||
// We just need to return an empty protocol message as the next AVK will be appended by the signing engine automatically | ||
async fn compute_signable(&self, _beacon: Epoch) -> StdResult<ProtocolMessage> { | ||
Ok(ProtocolMessage::new()) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[tokio::test] | ||
async fn test_compute_signable() { | ||
let mithril_stake_distribution_signable_builder = | ||
MithrilStakeDistributionSignableBuilder::default(); | ||
let signable = mithril_stake_distribution_signable_builder | ||
.compute_signable(Epoch(1)) | ||
.await | ||
.unwrap(); | ||
let signable_expected = ProtocolMessage::new(); | ||
assert_eq!(signable_expected, signable); | ||
} | ||
} |
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
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