Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Sep 3, 2024
1 parent bfc2e15 commit c4f9c15
Show file tree
Hide file tree
Showing 13 changed files with 194 additions and 267 deletions.
2 changes: 1 addition & 1 deletion consensus/src/proposal/block_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<T: Operations> Generator<T> {

candidate.sign(&ru.secret_key, ru.pubkey_bls.inner());

Ok(Message::new_candidate(candidate))
Ok(candidate.into())
}

async fn generate_block(
Expand Down
2 changes: 1 addition & 1 deletion consensus/src/ratification/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl RatificationHandler {
},
};

Message::new_quorum(quorum)
quorum.into()
}

pub(crate) fn reset(&mut self, iter: u8, validation: ValidationResult) {
Expand Down
2 changes: 1 addition & 1 deletion consensus/src/ratification/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl RatificationStep {
let ratification =
self::build_ratification_payload(ru, iteration, result);

let msg = Message::new_ratification(ratification);
let msg = Message::from(ratification);

// Publish ratification vote
info!(event = "send_vote", validation_bitset = result.sv().bitset);
Expand Down
2 changes: 1 addition & 1 deletion consensus/src/step_votes_reg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl AttInfoRegistry {

let payload = payload::Quorum { header, att };

Message::new_quorum(payload)
payload.into()
}

pub(crate) fn get_failed_atts(&self, to: u8) -> Vec<Option<IterationInfo>> {
Expand Down
5 changes: 2 additions & 3 deletions consensus/src/validation/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ fn final_result(
quorum: QuorumType,
) -> HandleMsgOutput {
let p = payload::ValidationResult::new(sv, vote, quorum);
let msg = Message::from_validation_result(p);

HandleMsgOutput::Ready(msg)
let m = Message::from(p);
HandleMsgOutput::Ready(m)
}

pub struct ValidationHandler {
Expand Down
2 changes: 1 addition & 1 deletion consensus/src/validation/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl<T: Operations + 'static> ValidationStep<T> {
// Sign and construct validation message
let validation = self::build_validation_payload(vote, ru, iteration);
info!(event = "send_vote", vote = ?validation.vote);
let msg = Message::new_validation(validation);
let msg = Message::from(validation);

// Publish
outbound.try_send(msg.clone());
Expand Down
Loading

0 comments on commit c4f9c15

Please sign in to comment.