Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fix up old_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rphmeier committed Jul 8, 2021
1 parent 1a101b0 commit f29b7b7
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions node/core/approval-voting/src/old_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
use super::*;
use super::approval_db::v1::Config;
use super::backend::{Backend, BackendWriteOp};
use polkadot_primitives::v1::{CandidateDescriptor, CoreIndex, GroupIndex, ValidatorSignature};
use polkadot_primitives::v1::{
CandidateDescriptor, CoreIndex, GroupIndex, ValidatorSignature,
DisputeStatement, ValidDisputeStatementKind,
};
use polkadot_node_primitives::approval::{
AssignmentCert, AssignmentCertKind, VRFOutput, VRFProof,
RELAY_VRF_MODULO_CONTEXT, DelayTranche,
Expand Down Expand Up @@ -814,7 +817,25 @@ fn accepts_and_imports_approval_after_assignment() {

assert_eq!(res, ApprovalCheckResult::Accepted);

assert_eq!(actions.len(), 0);
assert_eq!(actions.len(), 1);

assert_matches!(
&actions[0],
Action::InformDisputeCoordinator {
dispute_statement,
candidate_hash: c_hash,
validator_index: v,
..
} => {
assert_matches!(
dispute_statement.statement(),
&DisputeStatement::Valid(ValidDisputeStatementKind::ApprovalChecking)
);

assert_eq!(c_hash, &candidate_hash);
assert_eq!(v, &validator_index);
}
);

let write_ops = overlay_db.into_write_ops().collect::<Vec<BackendWriteOp>>();
assert_eq!(write_ops.len(), 1);
Expand Down

0 comments on commit f29b7b7

Please sign in to comment.