diff --git a/Code/test/tests/driver.rs b/Code/test/tests/driver.rs index eeef9355b..93d4006ba 100644 --- a/Code/test/tests/driver.rs +++ b/Code/test/tests/driver.rs @@ -272,7 +272,6 @@ fn driver_steps_proposer() { #[test] fn driver_steps_not_proposer_valid() { let value = Value::new(9999); - let value_id = value.id(); let sel = RotateProposer::default(); let env = TestEnv::new(move |_, _| Some(value)); @@ -320,7 +319,7 @@ fn driver_steps_not_proposer_valid() { desc: "Receive a proposal, prevote for it (v2)", input_event: Some(Event::Proposal(proposal.clone(), Validity::Valid)), expected_output: Some(Message::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), Some(value_id), my_addr) + Vote::new_prevote(Height::new(1), Round::new(0), Some(value.id()), my_addr) .signed(&my_sk), )), expected_round: Round::new(0), @@ -350,7 +349,7 @@ fn driver_steps_not_proposer_valid() { TestStep { desc: "v1 prevotes for its own proposal", input_event: Some(Event::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), Some(value_id), addr1) + Vote::new_prevote(Height::new(1), Round::new(0), Some(value.id()), addr1) .signed(&sk1), )), expected_output: None, @@ -367,11 +366,11 @@ fn driver_steps_not_proposer_valid() { TestStep { desc: "v3 prevotes for v1's proposal, it gets +2/3 prevotes, precommit for it (v2)", input_event: Some(Event::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), Some(value_id), addr3) + Vote::new_prevote(Height::new(1), Round::new(0), Some(value.id()), addr3) .signed(&sk3), )), expected_output: Some(Message::Vote( - Vote::new_precommit(Height::new(1), Round::new(0), Some(value_id), my_addr) + Vote::new_precommit(Height::new(1), Round::new(0), Some(value.id()), my_addr) .signed(&my_sk), )), expected_round: Round::new(0), @@ -413,7 +412,7 @@ fn driver_steps_not_proposer_valid() { TestStep { desc: "v1 precommits its proposal", input_event: Some(Event::Vote( - Vote::new_precommit(Height::new(1), Round::new(0), Some(value_id), addr1) + Vote::new_precommit(Height::new(1), Round::new(0), Some(value.id()), addr1) .signed(&sk1), )), expected_output: None, @@ -436,7 +435,7 @@ fn driver_steps_not_proposer_valid() { TestStep { desc: "v3 precommits for v1's proposal, it gets +2/3 precommits, decide it", input_event: Some(Event::Vote( - Vote::new_precommit(Height::new(1), Round::new(0), Some(value_id), addr3) + Vote::new_precommit(Height::new(1), Round::new(0), Some(value.id()), addr3) .signed(&sk3), )), expected_output: Some(Message::Decide(Round::new(0), value)), @@ -484,7 +483,6 @@ fn driver_steps_not_proposer_valid() { #[test] fn driver_steps_not_proposer_invalid() { let value = Value::new(9999); - let value_id = value.id(); let sel = RotateProposer::default(); let env = TestEnv::new(move |_, _| Some(value)); @@ -561,7 +559,7 @@ fn driver_steps_not_proposer_invalid() { TestStep { desc: "v1 prevotes for its own proposal", input_event: Some(Event::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), Some(value_id), addr1).signed(&sk1), + Vote::new_prevote(Height::new(1), Round::new(0), Some(value.id()), addr1).signed(&sk1), )), expected_output: None, expected_round: Round::new(0), @@ -577,7 +575,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_event: Some(Event::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), Some(value_id), addr3).signed(&sk3), + Vote::new_prevote(Height::new(1), Round::new(0), Some(value.id()), addr3).signed(&sk3), )), expected_output: Some(Message::ScheduleTimeout(Timeout::prevote(Round::new(0)))), expected_round: Round::new(0), @@ -634,7 +632,6 @@ fn driver_steps_not_proposer_invalid() { #[test] fn driver_steps_not_proposer_timeout_multiple_rounds() { let value = Value::new(9999); - let value_id = value.id(); let sel = RotateProposer::default(); let env = TestEnv::new(move |_, _| Some(value)); @@ -713,7 +710,7 @@ fn driver_steps_not_proposer_timeout_multiple_rounds() { TestStep { desc: "v1 prevotes for its own proposal", input_event: Some(Event::Vote( - Vote::new_prevote(Height::new(1), Round::new(0), Some(value_id), addr1) + Vote::new_prevote(Height::new(1), Round::new(0), Some(value.id()), addr1) .signed(&sk1), )), expected_output: None, @@ -765,7 +762,7 @@ fn driver_steps_not_proposer_timeout_multiple_rounds() { TestStep { desc: "v1 precommits its proposal", input_event: Some(Event::Vote( - Vote::new_precommit(Height::new(1), Round::new(0), Some(value_id), addr1) + Vote::new_precommit(Height::new(1), Round::new(0), Some(value.id()), addr1) .signed(&sk1), )), expected_output: None,