Skip to content

Commit

Permalink
Rename RoundData to Info
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Nov 23, 2023
1 parent 084acd8 commit 209f9bf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Code/driver/src/driver.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use malachite_round::state_machine::RoundData;
use malachite_round::state_machine::Info;

use malachite_common::{
Context, Proposal, Round, SignedVote, Timeout, TimeoutStep, Validator, ValidatorSet, Value,
Expand Down Expand Up @@ -266,7 +266,7 @@ where
let round_state = core::mem::take(&mut self.round_state);
let proposer = self.get_proposer(round_state.round);

let data = RoundData::new(event_round, &self.address, &proposer);
let data = Info::new(event_round, &self.address, &proposer);

// Multiplex the event with the round state.
let mux_event = match event {
Expand Down
4 changes: 2 additions & 2 deletions Code/round/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use core::fmt;

use crate::events::Event;
use crate::state_machine::RoundData;
use crate::state_machine::Info;
use crate::transition::Transition;

use malachite_common::{Context, Round};
Expand Down Expand Up @@ -76,7 +76,7 @@ where
}
}

pub fn apply_event(self, data: &RoundData<Ctx>, event: Event<Ctx>) -> Transition<Ctx> {
pub fn apply_event(self, data: &Info<Ctx>, event: Event<Ctx>) -> Transition<Ctx> {
crate::state_machine::apply_event(self, data, event)
}
}
Expand Down
8 changes: 4 additions & 4 deletions Code/round/src/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use crate::message::Message;
use crate::state::{State, Step};
use crate::transition::Transition;

/// Immutable data about the event and our node:
/// Immutable information about the event and our node:
/// - Address of our node
/// - Proposer for the round we are at
/// - Round for which the event is for, can be different than the round we are at
pub struct RoundData<'a, Ctx>
pub struct Info<'a, Ctx>
where
Ctx: Context,
{
Expand All @@ -18,7 +18,7 @@ where
pub proposer: &'a Ctx::Address,
}

impl<'a, Ctx> RoundData<'a, Ctx>
impl<'a, Ctx> Info<'a, Ctx>
where
Ctx: Context,
{
Expand Down Expand Up @@ -53,7 +53,7 @@ where
/// Commented numbers refer to line numbers in the spec paper.
pub fn apply_event<Ctx>(
mut state: State<Ctx>,
data: &RoundData<Ctx>,
data: &Info<Ctx>,
event: Event<Ctx>,
) -> Transition<Ctx>
where
Expand Down
6 changes: 3 additions & 3 deletions Code/test/tests/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use malachite_common::{Round, Timeout, TimeoutStep};
use malachite_round::events::Event;
use malachite_round::message::Message;
use malachite_round::state::{State, Step};
use malachite_round::state_machine::{apply_event, RoundData};
use malachite_round::state_machine::{apply_event, Info};

const ADDRESS: Address = Address::new([42; 20]);

Expand All @@ -20,7 +20,7 @@ fn test_propose() {
..Default::default()
};

let data = RoundData::new(round, &ADDRESS, &ADDRESS);
let data = Info::new(round, &ADDRESS, &ADDRESS);

let transition = apply_event(state.clone(), &data, Event::NewRoundProposer);

Expand Down Expand Up @@ -57,7 +57,7 @@ fn test_prevote() {
..Default::default()
};

let data = RoundData::new(Round::new(1), &ADDRESS, &ADDRESS);
let data = Info::new(Round::new(1), &ADDRESS, &ADDRESS);

let transition = apply_event(state, &data, Event::NewRound);

Expand Down

0 comments on commit 209f9bf

Please sign in to comment.