diff --git a/examples/src/simple_malicious.rs b/examples/src/simple_malicious.rs index b4ecae5..176bf4d 100644 --- a/examples/src/simple_malicious.rs +++ b/examples/src/simple_malicious.rs @@ -188,8 +188,8 @@ fn serialized_garbage() { let report1 = reports.remove(&v1).unwrap(); let report2 = reports.remove(&v2).unwrap(); - assert!(report1.provable_errors[&v0].verify(&v0).is_ok()); - assert!(report2.provable_errors[&v0].verify(&v0).is_ok()); + assert!(report1.provable_errors[&v0].verify().is_ok()); + assert!(report2.provable_errors[&v0].verify().is_ok()); } #[test] @@ -234,8 +234,8 @@ fn attributable_failure() { let report1 = reports.remove(&v1).unwrap(); let report2 = reports.remove(&v2).unwrap(); - assert!(report1.provable_errors[&v0].verify(&v0).is_ok()); - assert!(report2.provable_errors[&v0].verify(&v0).is_ok()); + assert!(report1.provable_errors[&v0].verify().is_ok()); + assert!(report2.provable_errors[&v0].verify().is_ok()); } #[test] @@ -280,6 +280,6 @@ fn attributable_failure_round2() { let report1 = reports.remove(&v1).unwrap(); let report2 = reports.remove(&v2).unwrap(); - assert!(report1.provable_errors[&v0].verify(&v0).is_ok()); - assert!(report2.provable_errors[&v0].verify(&v0).is_ok()); + assert!(report1.provable_errors[&v0].verify().is_ok()); + assert!(report2.provable_errors[&v0].verify().is_ok()); } diff --git a/manul/src/session/evidence.rs b/manul/src/session/evidence.rs index b85e011..4a2e9a6 100644 --- a/manul/src/session/evidence.rs +++ b/manul/src/session/evidence.rs @@ -250,18 +250,18 @@ where } /// Attempts to verify that the attached data constitutes enough evidence - /// to prove the malicious behavior. + /// to prove the malicious behavior of [`Self::guilty_party`]. /// /// Returns `Ok(())` if it is the case. - pub fn verify(&self, party: &SP::Verifier) -> Result<(), EvidenceError> { + pub fn verify(&self) -> Result<(), EvidenceError> { let deserializer = Deserializer::new::(); match &self.evidence { - EvidenceEnum::Protocol(evidence) => evidence.verify::(party, &deserializer), - EvidenceEnum::InvalidDirectMessage(evidence) => evidence.verify::(party, &deserializer), - EvidenceEnum::InvalidEchoBroadcast(evidence) => evidence.verify::(party, &deserializer), - EvidenceEnum::InvalidNormalBroadcast(evidence) => evidence.verify::(party, &deserializer), - EvidenceEnum::InvalidEchoPack(evidence) => evidence.verify(party, &deserializer), - EvidenceEnum::MismatchedBroadcasts(evidence) => evidence.verify::(party), + EvidenceEnum::Protocol(evidence) => evidence.verify::(&self.guilty_party, &deserializer), + EvidenceEnum::InvalidDirectMessage(evidence) => evidence.verify::(&self.guilty_party, &deserializer), + EvidenceEnum::InvalidEchoBroadcast(evidence) => evidence.verify::(&self.guilty_party, &deserializer), + EvidenceEnum::InvalidNormalBroadcast(evidence) => evidence.verify::(&self.guilty_party, &deserializer), + EvidenceEnum::InvalidEchoPack(evidence) => evidence.verify(&self.guilty_party, &deserializer), + EvidenceEnum::MismatchedBroadcasts(evidence) => evidence.verify::(&self.guilty_party), } } }