Skip to content

Commit

Permalink
LeaderOutput: add the PoolId for GP output, as it makes things way mo…
Browse files Browse the repository at this point in the history
…re practical
  • Loading branch information
vincenthz committed Oct 15, 2019
1 parent ad04e4f commit 67bbc79
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions chain-impl-mockchain/src/leadership/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct Leader {
pub enum LeaderOutput {
None,
Bft(bft::LeaderId),
GenesisPraos(genesis::Witness),
GenesisPraos(PoolId, genesis::Witness),
}

pub enum LeadershipConsensus {
Expand Down Expand Up @@ -122,7 +122,10 @@ impl LeadershipConsensus {
None => Ok(LeaderOutput::None),
Some(ref gen_leader) => {
match genesis_praos.leader(&gen_leader.node_id, &gen_leader.vrf_key, date) {
Ok(Some(witness)) => Ok(LeaderOutput::GenesisPraos(witness)),
Ok(Some(witness)) => Ok(LeaderOutput::GenesisPraos(
gen_leader.node_id.clone(),
witness,
)),
_ => Ok(LeaderOutput::None),
}
}
Expand Down

0 comments on commit 67bbc79

Please sign in to comment.