diff --git a/Code/driver/src/driver.rs b/Code/driver/src/driver.rs index 0e81d7708..92aba3cd6 100644 --- a/Code/driver/src/driver.rs +++ b/Code/driver/src/driver.rs @@ -4,7 +4,7 @@ use alloc::vec::Vec; use core::fmt; use malachite_common::{ - Context, Proposal, Round, SignedVote, Timeout, TimeoutStep, Validator, ValidatorSet, Vote, + Context, Proposal, Round, Timeout, TimeoutStep, Validator, ValidatorSet, Vote, }; use malachite_round::input::Input as RoundInput; use malachite_round::output::Output as RoundOutput; @@ -136,16 +136,9 @@ where match round_output { RoundOutput::NewRound(round) => Output::NewRound(self.height().clone(), round), - RoundOutput::Proposal(proposal) => { - // TODO: sign the proposal - Output::Propose(proposal) - } + RoundOutput::Proposal(proposal) => Output::Propose(proposal), - RoundOutput::Vote(vote) => { - // TODO: Move this outside of the driver - let signed_vote = self.ctx.sign_vote(vote); - Output::Vote(signed_vote) - } + RoundOutput::Vote(vote) => Output::Vote(vote), RoundOutput::ScheduleTimeout(timeout) => Output::ScheduleTimeout(timeout), @@ -153,10 +146,7 @@ where Output::GetValueAndScheduleTimeout(round, timeout) } - RoundOutput::Decision(value) => { - // TODO: update the state - Output::Decide(value.round, value.value) - } + RoundOutput::Decision(value) => Output::Decide(value.round, value.value), } } @@ -166,7 +156,7 @@ where Input::NewRound(height, round) => self.apply_new_round(height, round).await, Input::ProposeValue(round, value) => self.apply_propose_value(round, value).await, Input::Proposal(proposal, validity) => self.apply_proposal(proposal, validity).await, - Input::Vote(signed_vote) => self.apply_vote(signed_vote), + Input::Vote(vote) => self.apply_vote(vote), Input::TimeoutElapsed(timeout) => self.apply_timeout(timeout), } } @@ -207,32 +197,18 @@ where } } - fn apply_vote( - &mut self, - signed_vote: SignedVote, - ) -> Result>, Error> { + fn apply_vote(&mut self, vote: Ctx::Vote) -> Result>, Error> { let validator = self .validator_set - .get_by_address(signed_vote.validator_address()) - .ok_or_else(|| Error::ValidatorNotFound(signed_vote.validator_address().clone()))?; - - // TODO: Move this outside of the driver - if !self - .ctx - .verify_signed_vote(&signed_vote, validator.public_key()) - { - return Err(Error::InvalidVoteSignature( - signed_vote.clone(), - validator.clone(), - )); - } + .get_by_address(vote.validator_address()) + .ok_or_else(|| Error::ValidatorNotFound(vote.validator_address().clone()))?; - let vote_round = signed_vote.vote.round(); + let vote_round = vote.round(); let current_round = self.round(); let vote_output = self.vote_keeper - .apply_vote(signed_vote.vote, validator.voting_power(), current_round); + .apply_vote(vote, validator.voting_power(), current_round); let Some(vote_output) = vote_output else { return Ok(None); diff --git a/Code/driver/src/error.rs b/Code/driver/src/error.rs index 5846c161c..dd2ad9959 100644 --- a/Code/driver/src/error.rs +++ b/Code/driver/src/error.rs @@ -1,6 +1,6 @@ use core::fmt; -use malachite_common::{Context, SignedVote, Validator}; +use malachite_common::Context; /// The type of errors that can be yielded by the `Driver`. #[derive(Clone, Debug)] @@ -13,9 +13,6 @@ where /// Validator not found in validator set ValidatorNotFound(Ctx::Address), - - /// Invalid vote signature - InvalidVoteSignature(SignedVote, Ctx::Validator), } impl fmt::Display for Error @@ -27,11 +24,6 @@ where match self { Error::ProposerNotFound(addr) => write!(f, "Proposer not found: {addr}"), Error::ValidatorNotFound(addr) => write!(f, "Validator not found: {addr}"), - Error::InvalidVoteSignature(vote, validator) => write!( - f, - "Invalid vote signature by {} on vote {vote:?}", - validator.address() - ), } } } @@ -45,10 +37,6 @@ where match (self, other) { (Error::ProposerNotFound(addr1), Error::ProposerNotFound(addr2)) => addr1 == addr2, (Error::ValidatorNotFound(addr1), Error::ValidatorNotFound(addr2)) => addr1 == addr2, - ( - Error::InvalidVoteSignature(vote1, validator1), - Error::InvalidVoteSignature(vote2, validator2), - ) => vote1 == vote2 && validator1 == validator2, _ => false, } } diff --git a/Code/driver/src/input.rs b/Code/driver/src/input.rs index eda6d7944..6d25d5248 100644 --- a/Code/driver/src/input.rs +++ b/Code/driver/src/input.rs @@ -1,4 +1,4 @@ -use malachite_common::{Context, Round, SignedVote, Timeout}; +use malachite_common::{Context, Round, Timeout}; use crate::Validity; @@ -17,8 +17,8 @@ where /// Receive a proposal, of the given validity Proposal(Ctx::Proposal, Validity), - /// Receive a signed vote - Vote(SignedVote), + /// Receive a vote + Vote(Ctx::Vote), /// Receive a timeout TimeoutElapsed(Timeout), diff --git a/Code/driver/src/output.rs b/Code/driver/src/output.rs index d0565f484..ac234538d 100644 --- a/Code/driver/src/output.rs +++ b/Code/driver/src/output.rs @@ -1,6 +1,6 @@ use core::fmt; -use malachite_common::{Context, Round, SignedVote, Timeout}; +use malachite_common::{Context, Round, Timeout}; /// Messages emitted by the [`Driver`](crate::Driver) pub enum Output @@ -14,7 +14,7 @@ where Propose(Ctx::Proposal), /// Broadcast a vote for a value - Vote(SignedVote), + Vote(Ctx::Vote), /// Decide on a value Decide(Round, Ctx::Value), diff --git a/Code/test/src/utils.rs b/Code/test/src/utils.rs index fc962cf44..0e3fb1b16 100644 --- a/Code/test/src/utils.rs +++ b/Code/test/src/utils.rs @@ -79,84 +79,82 @@ pub fn proposal_input( Input::Proposal(proposal, validity) } -pub fn prevote_output( - round: Round, - addr: &Address, - sk: &PrivateKey, -) -> Option> { +pub fn prevote_output(round: Round, addr: &Address) -> Option> { let value = Value::new(9999); - Some(Output::Vote( - Vote::new_prevote(Height::new(1), round, NilOrVal::Val(value.id()), *addr).signed(sk), - )) + Some(Output::Vote(Vote::new_prevote( + Height::new(1), + round, + NilOrVal::Val(value.id()), + *addr, + ))) } -pub fn prevote_nil_output( - round: Round, - addr: &Address, - sk: &PrivateKey, -) -> Option> { - Some(Output::Vote( - Vote::new_prevote(Height::new(1), round, NilOrVal::Nil, *addr).signed(sk), - )) +pub fn prevote_nil_output(round: Round, addr: &Address) -> Option> { + Some(Output::Vote(Vote::new_prevote( + Height::new(1), + round, + NilOrVal::Nil, + *addr, + ))) } -pub fn prevote_input(addr: &Address, sk: &PrivateKey) -> Input { +pub fn prevote_input(addr: &Address) -> Input { let value = Value::new(9999); - Input::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - *addr, - ) - .signed(sk), - ) + Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + *addr, + )) } -pub fn prevote_nil_input(addr: &Address, sk: &PrivateKey) -> Input { - Input::Vote(Vote::new_prevote(Height::new(1), Round::new(0), NilOrVal::Nil, *addr).signed(sk)) +pub fn prevote_nil_input(addr: &Address) -> Input { + Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Nil, + *addr, + )) } -pub fn prevote_input_at(round: Round, addr: &Address, sk: &PrivateKey) -> Input { +pub fn prevote_input_at(round: Round, addr: &Address) -> Input { let value = Value::new(9999); - Input::Vote( - Vote::new_prevote(Height::new(1), round, NilOrVal::Val(value.id()), *addr).signed(sk), - ) + Input::Vote(Vote::new_prevote( + Height::new(1), + round, + NilOrVal::Val(value.id()), + *addr, + )) } -pub fn precommit_output( - round: Round, - value: Value, - addr: &Address, - sk: &PrivateKey, -) -> Option> { - Some(Output::Vote( - Vote::new_precommit(Height::new(1), round, NilOrVal::Val(value.id()), *addr).signed(sk), - )) +pub fn precommit_output(round: Round, value: Value, addr: &Address) -> Option> { + Some(Output::Vote(Vote::new_precommit( + Height::new(1), + round, + NilOrVal::Val(value.id()), + *addr, + ))) } -pub fn precommit_nil_output( - round: Round, - addr: &Address, - sk: &PrivateKey, -) -> Option> { - Some(Output::Vote( - Vote::new_precommit(Height::new(1), round, NilOrVal::Nil, *addr).signed(sk), - )) +pub fn precommit_nil_output(round: Round, addr: &Address) -> Option> { + Some(Output::Vote(Vote::new_precommit( + Height::new(1), + round, + NilOrVal::Nil, + *addr, + ))) } -pub fn precommit_input( - round: Round, - value: Value, - addr: &Address, - sk: &PrivateKey, -) -> Input { - Input::Vote( - Vote::new_precommit(Height::new(1), round, NilOrVal::Val(value.id()), *addr).signed(sk), - ) +pub fn precommit_input(round: Round, value: Value, addr: &Address) -> Input { + Input::Vote(Vote::new_precommit( + Height::new(1), + round, + NilOrVal::Val(value.id()), + *addr, + )) } pub fn decide_output(round: Round, value: Value) -> Option> { diff --git a/Code/test/tests/driver.rs b/Code/test/tests/driver.rs index 199378ccd..b2ff1b33a 100644 --- a/Code/test/tests/driver.rs +++ b/Code/test/tests/driver.rs @@ -30,7 +30,7 @@ pub fn output_to_input(output: Output) -> Option fn driver_steps_proposer() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([1, 2, 3]); + let [(v1, sk1), (v2, _sk2), (v3, _sk3)] = make_validators([1, 2, 3]); let (my_sk, my_addr) = (sk1, v1.address); let height = Height::new(1); @@ -75,15 +75,12 @@ fn driver_steps_proposer() { TestStep { desc: "Receive our own proposal, prevote for it (v1)", input: None, - expected_output: Some(Output::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - my_addr, - ) - .signed(&my_sk), - )), + expected_output: Some(Output::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + my_addr, + ))), expected_round: Round::new(0), new_state: State { height: Height::new(1), @@ -108,15 +105,12 @@ fn driver_steps_proposer() { }, TestStep { desc: "v2 prevotes for our proposal", - input: Some(Input::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v2.address, - ) - .signed(&sk2), - )), + input: Some(Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v2.address, + ))), expected_output: None, expected_round: Round::new(0), new_state: State { @@ -129,24 +123,18 @@ fn driver_steps_proposer() { }, TestStep { desc: "v3 prevotes for our proposal, we get +2/3 prevotes, precommit for it (v1)", - input: Some(Input::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v3.address, - ) - .signed(&sk3), - )), - expected_output: Some(Output::Vote( - Vote::new_precommit( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - my_addr, - ) - .signed(&my_sk), - )), + input: Some(Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v3.address, + ))), + expected_output: Some(Output::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + my_addr, + ))), expected_round: Round::new(0), new_state: State { height: Height::new(1), @@ -183,15 +171,12 @@ fn driver_steps_proposer() { }, TestStep { desc: "v2 precommits for our proposal", - input: Some(Input::Vote( - Vote::new_precommit( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v2.address, - ) - .signed(&sk2), - )), + input: Some(Input::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v2.address, + ))), expected_output: None, expected_round: Round::new(0), new_state: State { @@ -210,15 +195,12 @@ fn driver_steps_proposer() { }, TestStep { desc: "v3 precommits for our proposal, we get +2/3 precommits, decide it (v1)", - input: Some(Input::Vote( - Vote::new_precommit( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v3.address, - ) - .signed(&sk3), - )), + input: Some(Input::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v3.address, + ))), expected_output: Some(Output::Decide(Round::new(0), value)), expected_round: Round::new(0), new_state: State { @@ -272,10 +254,12 @@ fn driver_steps_proposer_timeout_get_value() { TestStep { desc: "Receive a propose timeout", input: Some(Input::TimeoutElapsed(Timeout::propose(Round::new(0)))), - expected_output: Some(Output::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), NilOrVal::Nil, my_addr) - .signed(&my_sk), - )), + expected_output: Some(Output::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Nil, + my_addr, + ))), expected_round: Round::new(0), new_state: State { round: Round::new(0), @@ -294,7 +278,7 @@ fn driver_steps_proposer_timeout_get_value() { fn driver_steps_not_proposer_valid() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([1, 2, 3]); + let [(v1, _sk1), (v2, sk2), (v3, _sk3)] = make_validators([1, 2, 3]); // Proposer is v1, so we are not the proposer let (my_sk, my_addr) = (sk2, v2.address); @@ -325,15 +309,12 @@ fn driver_steps_not_proposer_valid() { TestStep { desc: "Receive a proposal, prevote for it (v2)", input: Some(Input::Proposal(proposal.clone(), Validity::Valid)), - expected_output: Some(Output::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - my_addr, - ) - .signed(&my_sk), - )), + expected_output: Some(Output::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + my_addr, + ))), expected_round: Round::new(0), new_state: State { height: Height::new(1), @@ -358,15 +339,12 @@ fn driver_steps_not_proposer_valid() { }, TestStep { desc: "v1 prevotes for its own proposal", - input: Some(Input::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v1.address, - ) - .signed(&sk1), - )), + input: Some(Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v1.address, + ))), expected_output: None, expected_round: Round::new(0), new_state: State { @@ -379,24 +357,18 @@ fn driver_steps_not_proposer_valid() { }, TestStep { desc: "v3 prevotes for v1's proposal, it gets +2/3 prevotes, precommit for it (v2)", - input: Some(Input::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v3.address, - ) - .signed(&sk3), - )), - expected_output: Some(Output::Vote( - Vote::new_precommit( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - my_addr, - ) - .signed(&my_sk), - )), + input: Some(Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v3.address, + ))), + expected_output: Some(Output::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + my_addr, + ))), expected_round: Round::new(0), new_state: State { height: Height::new(1), @@ -433,15 +405,12 @@ fn driver_steps_not_proposer_valid() { }, TestStep { desc: "v1 precommits its proposal", - input: Some(Input::Vote( - Vote::new_precommit( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v1.address, - ) - .signed(&sk1), - )), + input: Some(Input::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v1.address, + ))), expected_output: None, expected_round: Round::new(0), new_state: State { @@ -460,15 +429,12 @@ fn driver_steps_not_proposer_valid() { }, TestStep { desc: "v3 precommits for v1's proposal, it gets +2/3 precommits, decide it", - input: Some(Input::Vote( - Vote::new_precommit( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v3.address, - ) - .signed(&sk3), - )), + input: Some(Input::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v3.address, + ))), expected_output: Some(Output::Decide(Round::new(0), value)), expected_round: Round::new(0), new_state: State { @@ -494,7 +460,7 @@ fn driver_steps_not_proposer_valid() { fn driver_steps_not_proposer_invalid() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([1, 2, 3]); + let [(v1, _sk1), (v2, sk2), (v3, _sk3)] = make_validators([1, 2, 3]); // Proposer is v1, so we are not the proposer let (my_sk, my_addr) = (sk2, v2.address); @@ -526,7 +492,7 @@ fn driver_steps_not_proposer_invalid() { desc: "Receive an invalid proposal, prevote for nil (v2)", input: Some(Input::Proposal(proposal.clone(), Validity::Invalid)), expected_output: Some(Output::Vote( - Vote::new_prevote(Height::new(1),Round::new(0), NilOrVal::Nil, my_addr).signed(&my_sk), + Vote::new_prevote(Height::new(1),Round::new(0), NilOrVal::Nil, my_addr) )), expected_round: Round::new(0), new_state: State { @@ -553,7 +519,7 @@ fn driver_steps_not_proposer_invalid() { TestStep { desc: "v1 prevotes for its own proposal", input: Some(Input::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), NilOrVal::Val(value.id()), v1.address).signed(&sk1), + Vote::new_prevote(Height::new(1), Round::new(0), NilOrVal::Val(value.id()), v1.address) )), expected_output: None, expected_round: Round::new(0), @@ -568,7 +534,7 @@ fn driver_steps_not_proposer_invalid() { TestStep { desc: "v3 prevotes for v1's proposal, we have polka for any, schedule prevote timeout (v2)", input: Some(Input::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), NilOrVal::Val(value.id()), v3.address).signed(&sk3), + Vote::new_prevote(Height::new(1), Round::new(0), NilOrVal::Val(value.id()), v3.address) )), expected_output: Some(Output::ScheduleTimeout(Timeout::prevote(Round::new(0)))), expected_round: Round::new(0), @@ -584,7 +550,7 @@ fn driver_steps_not_proposer_invalid() { desc: "prevote timeout elapses, we precommit for nil (v2)", input: Some(Input::TimeoutElapsed(Timeout::prevote(Round::new(0)))), expected_output: Some(Output::Vote( - Vote::new_precommit(Height::new(1), Round::new(0), NilOrVal::Nil, my_addr).signed(&my_sk), + Vote::new_precommit(Height::new(1), Round::new(0), NilOrVal::Nil, my_addr) )), expected_round: Round::new(0), new_state: State { @@ -706,7 +672,7 @@ fn driver_steps_not_proposer_other_round() { fn driver_steps_not_proposer_timeout_multiple_rounds() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([1, 3, 1]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([1, 3, 1]); // Proposer is v1, so we, v3, are not the proposer let (my_sk, my_addr) = (sk3, v3.address); @@ -737,10 +703,12 @@ fn driver_steps_not_proposer_timeout_multiple_rounds() { TestStep { desc: "Receive a propose timeout, prevote for nil (v3)", input: Some(Input::TimeoutElapsed(Timeout::propose(Round::new(0)))), - expected_output: Some(Output::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), NilOrVal::Nil, my_addr) - .signed(&my_sk), - )), + expected_output: Some(Output::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Nil, + my_addr, + ))), expected_round: Round::new(0), new_state: State { round: Round::new(0), @@ -767,15 +735,12 @@ fn driver_steps_not_proposer_timeout_multiple_rounds() { // v1 prevotes for its own proposal TestStep { desc: "v1 prevotes for its own proposal", - input: Some(Input::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v1.address, - ) - .signed(&sk1), - )), + input: Some(Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v1.address, + ))), expected_output: None, expected_round: Round::new(0), new_state: State { @@ -789,14 +754,18 @@ fn driver_steps_not_proposer_timeout_multiple_rounds() { // v2 prevotes for nil, we get +2/3 nil prevotes and precommit for nil TestStep { desc: "v2 prevotes for nil, we get +2/3 prevotes, precommit for nil", - input: Some(Input::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), NilOrVal::Nil, v2.address) - .signed(&sk2), - )), - expected_output: Some(Output::Vote( - Vote::new_precommit(Height::new(1), Round::new(0), NilOrVal::Nil, my_addr) - .signed(&my_sk), - )), + input: Some(Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Nil, + v2.address, + ))), + expected_output: Some(Output::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Nil, + my_addr, + ))), expected_round: Round::new(0), new_state: State { height: Height::new(1), @@ -823,15 +792,12 @@ fn driver_steps_not_proposer_timeout_multiple_rounds() { // v1 precommits its proposal TestStep { desc: "v1 precommits its proposal", - input: Some(Input::Vote( - Vote::new_precommit( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v1.address, - ) - .signed(&sk1), - )), + input: Some(Input::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v1.address, + ))), expected_output: None, expected_round: Round::new(0), new_state: State { @@ -845,10 +811,12 @@ fn driver_steps_not_proposer_timeout_multiple_rounds() { // v2 precommits for nil TestStep { desc: "v2 precommits for nil", - input: Some(Input::Vote( - Vote::new_precommit(Height::new(1), Round::new(0), NilOrVal::Nil, v2.address) - .signed(&sk2), - )), + input: Some(Input::Vote(Vote::new_precommit( + Height::new(1), + Round::new(0), + NilOrVal::Nil, + v2.address, + ))), expected_output: Some(Output::ScheduleTimeout(Timeout::precommit(Round::new(0)))), expected_round: Round::new(0), new_state: State { @@ -943,7 +911,7 @@ fn driver_steps_proposer_not_found() { fn driver_steps_validator_not_found() { let value = Value::new(9999); - let [(v1, _sk1), (v2, sk2), (v3, sk3)] = make_validators([1, 2, 3]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([1, 2, 3]); let (my_sk, my_addr) = (sk3.clone(), v3.address); @@ -962,65 +930,23 @@ fn driver_steps_validator_not_found() { .expect("execute succeeded"); // v2 prevotes for some proposal, we cannot find it in the validator set => error - let output = block_on( - driver.process(Input::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v2.address, - ) - .signed(&sk2), - )), - ); + let output = block_on(driver.process(Input::Vote(Vote::new_prevote( + Height::new(1), + Round::new(0), + NilOrVal::Val(value.id()), + v2.address, + )))); assert_eq!(output, Err(Error::ValidatorNotFound(v2.address))); } -#[test] -fn driver_steps_invalid_signature() { - let value = Value::new(9999); - - let [(v1, sk1), (v2, _sk2), (v3, sk3)] = make_validators([1, 2, 3]); - - let (my_sk, my_addr) = (sk3.clone(), v3.address); - - let height = Height::new(1); - let ctx = TestContext::new(my_sk.clone()); - - let sel = FixedProposer::new(v1.address); - let vs = ValidatorSet::new(vec![v1.clone(), v2.clone(), v3.clone()]); - - let mut driver = Driver::new(ctx, height, sel, vs, my_addr, Default::default()); - - // Start new round - block_on(driver.process(Input::NewRound(Height::new(1), Round::new(0)))) - .expect("execute succeeded"); - - // v2 prevotes for some proposal, with an invalid signature, - // ie. signed by v1 instead of v2, just a way of forging an invalid signature - let output = block_on( - driver.process(Input::Vote( - Vote::new_prevote( - Height::new(1), - Round::new(0), - NilOrVal::Val(value.id()), - v2.address, - ) - .signed(&sk1), - )), - ); - - assert!(matches!(output, Err(Error::InvalidVoteSignature(_, _)))); -} - #[test] fn driver_steps_skip_round_skip_threshold() { let value = Value::new(9999); let sel = RotateProposer; - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([1, 1, 1]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([1, 1, 1]); // Proposer is v1, so we, v3, are not the proposer let (my_sk, my_addr) = (sk3, v3.address); @@ -1050,9 +976,12 @@ fn driver_steps_skip_round_skip_threshold() { TestStep { desc: "Receive a propose timeout, prevote for nil (v3)", input: Some(Input::TimeoutElapsed(Timeout::propose(Round::new(0)))), - expected_output: Some(Output::Vote( - Vote::new_prevote(height, Round::new(0), NilOrVal::Nil, my_addr).signed(&my_sk), - )), + expected_output: Some(Output::Vote(Vote::new_prevote( + height, + Round::new(0), + NilOrVal::Nil, + my_addr, + ))), expected_round: Round::new(0), new_state: State { height, @@ -1079,10 +1008,12 @@ fn driver_steps_skip_round_skip_threshold() { // v1 prevotes for its own proposal TestStep { desc: "v1 prevotes for its own proposal in round 1", - input: Some(Input::Vote( - Vote::new_prevote(height, Round::new(1), NilOrVal::Val(value.id()), v1.address) - .signed(&sk1), - )), + input: Some(Input::Vote(Vote::new_prevote( + height, + Round::new(1), + NilOrVal::Val(value.id()), + v1.address, + ))), expected_output: None, expected_round: Round::new(0), new_state: State { @@ -1096,10 +1027,12 @@ fn driver_steps_skip_round_skip_threshold() { // v2 prevotes for v1 proposal in round 1, expected output is to move to next round TestStep { desc: "v2 prevotes for v1 proposal, we get +1/3 messages from future round", - input: Some(Input::Vote( - Vote::new_prevote(height, Round::new(1), NilOrVal::Val(value.id()), v2.address) - .signed(&sk2), - )), + input: Some(Input::Vote(Vote::new_prevote( + height, + Round::new(1), + NilOrVal::Val(value.id()), + v2.address, + ))), expected_output: Some(Output::NewRound(height, Round::new(1))), expected_round: Round::new(1), new_state: State { @@ -1121,7 +1054,7 @@ fn driver_steps_skip_round_quorum_threshold() { let sel = RotateProposer; - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([1, 2, 1]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([1, 2, 1]); // Proposer is v1, so we, v3, are not the proposer let (my_sk, my_addr) = (sk3, v3.address); @@ -1151,9 +1084,12 @@ fn driver_steps_skip_round_quorum_threshold() { TestStep { desc: "Receive a propose timeout, prevote for nil (v3)", input: Some(Input::TimeoutElapsed(Timeout::propose(Round::new(0)))), - expected_output: Some(Output::Vote( - Vote::new_prevote(height, Round::new(0), NilOrVal::Nil, my_addr).signed(&my_sk), - )), + expected_output: Some(Output::Vote(Vote::new_prevote( + height, + Round::new(0), + NilOrVal::Nil, + my_addr, + ))), expected_round: Round::new(0), new_state: State { height, @@ -1180,10 +1116,12 @@ fn driver_steps_skip_round_quorum_threshold() { // v1 prevotes for its own proposal TestStep { desc: "v1 prevotes for its own proposal in round 1", - input: Some(Input::Vote( - Vote::new_prevote(height, Round::new(1), NilOrVal::Val(value.id()), v1.address) - .signed(&sk1), - )), + input: Some(Input::Vote(Vote::new_prevote( + height, + Round::new(1), + NilOrVal::Val(value.id()), + v1.address, + ))), expected_output: None, expected_round: Round::new(0), new_state: State { @@ -1197,10 +1135,12 @@ fn driver_steps_skip_round_quorum_threshold() { // v2 prevotes for v1 proposal in round 1, expected output is to move to next round TestStep { desc: "v2 prevotes for v1 proposal, we get +1/3 messages from future round", - input: Some(Input::Vote( - Vote::new_prevote(height, Round::new(1), NilOrVal::Val(value.id()), v2.address) - .signed(&sk2), - )), + input: Some(Input::Vote(Vote::new_prevote( + height, + Round::new(1), + NilOrVal::Val(value.id()), + v2.address, + ))), expected_output: Some(Output::NewRound(height, Round::new(1))), expected_round: Round::new(1), new_state: State { diff --git a/Code/test/tests/driver_extra.rs b/Code/test/tests/driver_extra.rs index 2557b500c..4f1e5dc26 100644 --- a/Code/test/tests/driver_extra.rs +++ b/Code/test/tests/driver_extra.rs @@ -71,7 +71,7 @@ pub fn output_to_input(output: Output) -> Option fn driver_steps_decide_current_with_no_locked_no_valid() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 3, 2]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([2, 3, 2]); let (my_sk, my_addr) = (sk3.clone(), v3.address); let height = Height::new(1); @@ -91,14 +91,14 @@ fn driver_steps_decide_current_with_no_locked_no_valid() { }, TestStep { desc: "v1 precommits a proposal", - input: precommit_input(Round::new(0), value, &v1.address, &sk1), + input: precommit_input(Round::new(0), value, &v1.address), expected_output: None, expected_round: Round::new(0), new_state: propose_state(Round::new(0)), }, TestStep { desc: "v2 precommits for same proposal, we get +2/3 precommit, start precommit timer", - input: precommit_input(Round::new(0), value, &v2.address, &sk2), + input: precommit_input(Round::new(0), value, &v2.address), expected_output: start_precommit_timer_output(Round::new(0)), expected_round: Round::new(0), new_state: propose_state(Round::new(0)), @@ -144,7 +144,7 @@ fn driver_steps_decide_current_with_no_locked_no_valid() { fn driver_steps_decide_previous_with_no_locked_no_valid() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 3, 2]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([2, 3, 2]); let (my_sk, my_addr) = (sk3.clone(), v3.address); let height = Height::new(1); @@ -165,34 +165,34 @@ fn driver_steps_decide_previous_with_no_locked_no_valid() { TestStep { desc: "Timeout propopse, prevote for nil (v3)", input: timeout_propose_input(Round::new(0)), - expected_output: prevote_nil_output(Round::new(0), &my_addr, &my_sk), + expected_output: prevote_nil_output(Round::new(0), &my_addr), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v1 prevotes a proposal", - input: prevote_input(&v1.address, &sk1), + input: prevote_input(&v1.address), expected_output: None, expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v2 prevotes for same proposal, we get +2/3 prevotes, start prevote timer", - input: prevote_input(&v2.address, &sk2), + input: prevote_input(&v2.address), expected_output: start_prevote_timer_output(Round::new(0)), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v1 precommits a proposal", - input: precommit_input(Round::new(0), value, &v1.address, &sk1), + input: precommit_input(Round::new(0), value, &v1.address), expected_output: None, expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v2 precommits for same proposal, we get +2/3 precommit, start precommit timer", - input: precommit_input(Round::new(0), value, &v2.address, &sk2), + input: precommit_input(Round::new(0), value, &v2.address), expected_output: start_precommit_timer_output(Round::new(0)), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), @@ -245,7 +245,7 @@ fn driver_steps_decide_previous_with_no_locked_no_valid() { fn driver_steps_decide_previous_with_locked_and_valid() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 3, 2]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([2, 3, 2]); let (my_sk, my_addr) = (sk3.clone(), v3.address); let height = Height::new(1); @@ -266,20 +266,20 @@ fn driver_steps_decide_previous_with_locked_and_valid() { TestStep { desc: "Timeout propopse, prevote for nil (v3)", input: timeout_propose_input(Round::new(0)), - expected_output: prevote_nil_output(Round::new(0), &my_addr, &my_sk), + expected_output: prevote_nil_output(Round::new(0), &my_addr), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v1 prevotes a proposal", - input: prevote_input(&v1.address, &sk1), + input: prevote_input(&v1.address), expected_output: None, expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v2 prevotes for same proposal, we get +2/3 prevotes, start prevote timer", - input: prevote_input(&v2.address, &sk2), + input: prevote_input(&v2.address), expected_output: start_prevote_timer_output(Round::new(0)), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), @@ -287,7 +287,7 @@ fn driver_steps_decide_previous_with_locked_and_valid() { TestStep { desc: "Receive proposal, L37-L43", input: proposal_input(Round::new(0), value, Round::Nil, Validity::Valid), - expected_output: precommit_output(Round::new(0), Value::new(9999), &v3.address, &sk3), + expected_output: precommit_output(Round::new(0), Value::new(9999), &v3.address), expected_round: Round::new(0), new_state: precommit_state_with_proposal_and_locked_and_valid( Round::new(0), @@ -296,7 +296,7 @@ fn driver_steps_decide_previous_with_locked_and_valid() { }, TestStep { desc: "v2 precommits for value in round 1, i.e. f+1 vote for round 1 from v2", - input: precommit_input(Round::new(1), Value::new(9999), &v2.address, &sk2), + input: precommit_input(Round::new(1), Value::new(9999), &v2.address), expected_output: new_round_output(Round::new(1)), expected_round: Round::new(1), new_state: new_round_with_proposal_and_locked_and_valid( @@ -316,7 +316,7 @@ fn driver_steps_decide_previous_with_locked_and_valid() { }, TestStep { desc: "v1 precommits for round 0 and same proposal", - input: precommit_input(Round::new(0), value, &v1.address, &sk1), + input: precommit_input(Round::new(0), value, &v1.address), expected_output: None, expected_round: Round::new(1), new_state: propose_state_with_proposal_and_locked_and_valid( @@ -326,7 +326,7 @@ fn driver_steps_decide_previous_with_locked_and_valid() { }, TestStep { desc: "v2 precommits for round 0 and same proposal, we get +2/3 precommit, decide", - input: precommit_input(Round::new(0), value, &v2.address, &sk2), + input: precommit_input(Round::new(0), value, &v2.address), expected_output: decide_output(Round::new(0), value), expected_round: Round::new(1), new_state: decided_state_with_proposal_and_locked_and_valid( @@ -366,7 +366,7 @@ fn driver_steps_decide_previous_with_locked_and_valid() { fn driver_steps_polka_previous_with_locked() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 2, 3]); + let [(v1, _sk1), (v2, sk2), (v3, _sk3)] = make_validators([2, 2, 3]); let (my_sk, my_addr) = (sk2, v2.address); let height = Height::new(1); @@ -387,7 +387,7 @@ fn driver_steps_polka_previous_with_locked() { TestStep { desc: "receive a proposal from v1 - L22 send prevote", input: proposal_input(Round::new(0), value, Round::Nil, Validity::Valid), - expected_output: prevote_output(Round::new(0), &my_addr, &my_sk), + expected_output: prevote_output(Round::new(0), &my_addr), expected_round: Round::new(0), new_state: prevote_state( Round::new(0), @@ -396,7 +396,7 @@ fn driver_steps_polka_previous_with_locked() { }, TestStep { desc: "v3 prevotes the proposal", - input: prevote_input(&v3.address, &sk3), + input: prevote_input(&v3.address), expected_output: None, expected_round: Round::new(0), new_state: prevote_state( @@ -406,8 +406,8 @@ fn driver_steps_polka_previous_with_locked() { }, TestStep { desc: "v1 prevotes for same proposal, we get +2/3 prevotes, precommit", - input: prevote_input(&v1.address, &sk1), - expected_output: precommit_output(Round::new(0), value, &my_addr, &my_sk), + input: prevote_input(&v1.address), + expected_output: precommit_output(Round::new(0), value, &my_addr), expected_round: Round::new(0), new_state: precommit_state_with_proposal_and_locked_and_valid( Round::new(0), @@ -416,7 +416,7 @@ fn driver_steps_polka_previous_with_locked() { }, TestStep { desc: "Receive f+1 vote for round 1 from v3", - input: precommit_input(Round::new(1), Value::new(8888), &v3.address, &sk3), + input: precommit_input(Round::new(1), Value::new(8888), &v3.address), expected_output: new_round_output(Round::new(1)), expected_round: Round::new(1), new_state: new_round_with_proposal_and_locked_and_valid( @@ -437,7 +437,7 @@ fn driver_steps_polka_previous_with_locked() { TestStep { desc: "Receive our own proposal", input: proposal_input(Round::new(1), value, Round::new(0), Validity::Valid), - expected_output: prevote_output(Round::new(1), &my_addr, &my_sk), + expected_output: prevote_output(Round::new(1), &my_addr), expected_round: Round::new(1), new_state: prevote_state_with_proposal_and_locked_and_valid( Round::new(1), @@ -474,7 +474,7 @@ fn driver_steps_polka_previous_with_locked() { fn driver_steps_polka_previous_invalid_proposal() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 3, 2]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([2, 3, 2]); let (my_sk, my_addr) = (sk3, v3.address); let height = Height::new(1); @@ -495,27 +495,27 @@ fn driver_steps_polka_previous_invalid_proposal() { TestStep { desc: "timeout propopse, prevote for nil (v3)", input: timeout_propose_input(Round::new(0)), - expected_output: prevote_nil_output(Round::new(0), &my_addr, &my_sk), + expected_output: prevote_nil_output(Round::new(0), &my_addr), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v1 prevotes a proposal", - input: prevote_input(&v1.address, &sk1), + input: prevote_input(&v1.address), expected_output: None, expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v2 prevotes for same proposal, we get +2/3 prevotes, start prevote timer", - input: prevote_input(&v2.address, &sk2), + input: prevote_input(&v2.address), expected_output: start_prevote_timer_output(Round::new(0)), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "Receive f+1 vote for round 1 from v3", - input: prevote_input_at(Round::new(1), &v2.address, &sk2), + input: prevote_input_at(Round::new(1), &v2.address), expected_output: new_round_output(Round::new(1)), expected_round: Round::new(1), new_state: new_round(Round::new(1)), @@ -530,7 +530,7 @@ fn driver_steps_polka_previous_invalid_proposal() { TestStep { desc: "receive an invalid proposal for round 0", input: proposal_input(Round::new(1), value, Round::new(0), Validity::Invalid), - expected_output: prevote_nil_output(Round::new(1), &my_addr, &my_sk), + expected_output: prevote_nil_output(Round::new(1), &my_addr), expected_round: Round::new(1), new_state: prevote_state(Round::new(1)), }, @@ -573,7 +573,7 @@ fn driver_steps_polka_previous_invalid_proposal() { fn driver_steps_polka_previous_with_no_locked() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 2, 3]); + let [(v1, _sk1), (v2, sk2), (v3, _sk3)] = make_validators([2, 2, 3]); let (my_sk, my_addr) = (sk2, v2.address); let height = Height::new(1); @@ -594,20 +594,20 @@ fn driver_steps_polka_previous_with_no_locked() { TestStep { desc: "Timeout propopse, prevote for nil (v2)", input: timeout_propose_input(Round::new(0)), - expected_output: prevote_nil_output(Round::new(0), &my_addr, &my_sk), + expected_output: prevote_nil_output(Round::new(0), &my_addr), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v3 prevotes for some proposal", - input: prevote_input(&v3.address, &sk3), + input: prevote_input(&v3.address), expected_output: None, expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), }, TestStep { desc: "v1 prevotes for same proposal, we get +2/3 prevotes, start timeout prevote", - input: prevote_input(&v1.address, &sk1), + input: prevote_input(&v1.address), expected_output: start_prevote_timer_output(Round::new(0)), expected_round: Round::new(0), new_state: prevote_state(Round::new(0)), @@ -615,7 +615,7 @@ fn driver_steps_polka_previous_with_no_locked() { TestStep { desc: "timeout prevote, prevote for nil (v2)", input: timeout_prevote_input(Round::new(0)), - expected_output: precommit_nil_output(Round::new(0), &my_addr, &my_sk), + expected_output: precommit_nil_output(Round::new(0), &my_addr), expected_round: Round::new(0), new_state: precommit_state(Round::new(0)), }, @@ -632,7 +632,7 @@ fn driver_steps_polka_previous_with_no_locked() { }, TestStep { desc: "Receive f+1 vote for round 1 from v3", - input: prevote_input_at(Round::new(1), &v3.address, &sk3), + input: prevote_input_at(Round::new(1), &v3.address), expected_output: new_round_output(Round::new(1)), expected_round: Round::new(1), new_state: new_round_with_proposal_and_valid( @@ -654,7 +654,7 @@ fn driver_steps_polka_previous_with_no_locked() { TestStep { desc: "Receive our own proposal, prevote nil as we are not locked on the value", input: proposal_input(Round::new(1), value, Round::new(0), Validity::Valid), - expected_output: prevote_nil_output(Round::new(1), &my_addr, &my_sk), + expected_output: prevote_nil_output(Round::new(1), &my_addr), expected_round: Round::new(1), new_state: prevote_state_with_proposal_and_valid( Round::new(1), @@ -682,7 +682,7 @@ fn driver_steps_polka_previous_with_no_locked() { // L44 - polkaNil is replayed and v3 precommits for nil (step precommit) #[test] fn driver_steps_polka_nil_and_timout_propose() { - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 3, 2]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([2, 3, 2]); let (my_sk, my_addr) = (sk3.clone(), v3.address); let height = Height::new(1); @@ -702,14 +702,14 @@ fn driver_steps_polka_nil_and_timout_propose() { }, TestStep { desc: "v1 prevotes nil", - input: prevote_nil_input(&v1.address, &sk1), + input: prevote_nil_input(&v1.address), expected_output: None, expected_round: Round::new(0), new_state: propose_state(Round::new(0)), }, TestStep { desc: "v2 prevotes for for nil, we get polkaNil, but we are in Propose step", - input: prevote_nil_input(&v2.address, &sk2), + input: prevote_nil_input(&v2.address), expected_output: None, expected_round: Round::new(0), new_state: propose_state(Round::new(0)), @@ -717,7 +717,7 @@ fn driver_steps_polka_nil_and_timout_propose() { TestStep { desc: "Timeout propose, prevote for nil then precommit for nil", input: timeout_propose_input(Round::new(0)), - expected_output: precommit_nil_output(Round::new(0), &my_addr, &my_sk), + expected_output: precommit_nil_output(Round::new(0), &my_addr), expected_round: Round::new(0), new_state: precommit_state(Round::new(0)), }, @@ -743,7 +743,7 @@ fn driver_steps_polka_nil_and_timout_propose() { fn driver_steps_polka_value_then_proposal() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 3, 2]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([2, 3, 2]); let (my_sk, my_addr) = (sk3.clone(), v3.address); let height = Height::new(1); @@ -763,14 +763,14 @@ fn driver_steps_polka_value_then_proposal() { }, TestStep { desc: "v1 prevotes a proposal", - input: prevote_input(&v1.address, &sk1), + input: prevote_input(&v1.address), expected_output: None, expected_round: Round::new(0), new_state: propose_state(Round::new(0)), }, TestStep { desc: "v2 prevotes for same proposal, we get +2/3 prevotes, but we are in Propose step", - input: prevote_input(&v2.address, &sk2), + input: prevote_input(&v2.address), expected_output: None, expected_round: Round::new(0), new_state: propose_state(Round::new(0)), @@ -778,7 +778,7 @@ fn driver_steps_polka_value_then_proposal() { TestStep { desc: "receive a proposal from v1 - L22 send prevote", input: proposal_input(Round::new(0), value, Round::Nil, Validity::Valid), - expected_output: precommit_output(Round::new(0), value, &my_addr, &my_sk), + expected_output: precommit_output(Round::new(0), value, &my_addr), expected_round: Round::new(0), new_state: precommit_state_with_proposal_and_locked_and_valid( Round::new(0), @@ -807,7 +807,7 @@ fn driver_steps_polka_value_then_proposal() { fn driver_steps_polka_any_then_proposal_other() { let value = Value::new(9999); - let [(v1, sk1), (v2, sk2), (v3, sk3)] = make_validators([2, 3, 2]); + let [(v1, _sk1), (v2, _sk2), (v3, sk3)] = make_validators([2, 3, 2]); let (my_sk, my_addr) = (sk3.clone(), v3.address); let height = Height::new(1); @@ -827,14 +827,14 @@ fn driver_steps_polka_any_then_proposal_other() { }, TestStep { desc: "v1 prevotes for nil", - input: prevote_nil_input(&v1.address, &sk1), + input: prevote_nil_input(&v1.address), expected_output: None, expected_round: Round::new(0), new_state: propose_state(Round::new(0)), }, TestStep { desc: "v2 prevotes for same proposal, we get polkaAny, but we are in Propose step", - input: prevote_input(&v2.address, &sk2), + input: prevote_input(&v2.address), expected_output: None, expected_round: Round::new(0), new_state: propose_state(Round::new(0)),