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

Commit

Permalink
remove the runtime check and test
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Nov 15, 2022
1 parent 5d607f6 commit a5bff0c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 69 deletions.
5 changes: 0 additions & 5 deletions runtime/parachains/src/disputes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,6 @@ pub mod pallet {
PotentialSpam,
/// A dispute where there are only votes on one side.
SingleSidedDispute,
/// No backing votes were provides along dispute statements.
MissingBackingVotes,
}

#[pallet::call]
Expand Down Expand Up @@ -1232,9 +1230,6 @@ impl<T: Config> Pallet<T> {
Error::<T>::SingleSidedDispute,
);

// Reject statements with no accompanying backing votes.
ensure!(!backers.is_empty(), Error::<T>::MissingBackingVotes,);

<BackersOnDisputes<T>>::insert(&set.session, &set.candidate_hash, backers.clone());

let DisputeStatementSet { ref session, ref candidate_hash, .. } = set;
Expand Down
64 changes: 0 additions & 64 deletions runtime/parachains/src/disputes/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,70 +737,6 @@ fn test_provide_multi_dispute_is_providing() {
})
}

#[test]
fn test_disputes_with_missing_backing_votes_are_rejected() {
new_test_ext(Default::default()).execute_with(|| {
let v0 = <ValidatorId as CryptoType>::Pair::generate().0;
let v1 = <ValidatorId as CryptoType>::Pair::generate().0;

run_to_block(3, |b| {
// a new session at each block
if b == 1 {
Some((
true,
b,
vec![(&0, v0.public()), (&1, v1.public())],
Some(vec![(&0, v0.public()), (&1, v1.public())]),
))
} else {
Some((true, b, vec![(&1, v1.public())], Some(vec![(&1, v1.public())])))
}
});

let candidate_hash = CandidateHash(sp_core::H256::repeat_byte(1));
let session = 1;

let stmts = vec![DisputeStatementSet {
candidate_hash: candidate_hash.clone(),
session,
statements: vec![
(
DisputeStatement::Valid(ValidDisputeStatementKind::Explicit),
ValidatorIndex(0),
v0.sign(
&ExplicitDisputeStatement {
valid: true,
candidate_hash: candidate_hash.clone(),
session,
}
.signing_payload(),
),
),
(
DisputeStatement::Invalid(InvalidDisputeStatementKind::Explicit),
ValidatorIndex(1),
v1.sign(
&ExplicitDisputeStatement {
valid: false,
candidate_hash: candidate_hash.clone(),
session,
}
.signing_payload(),
),
),
],
}];

assert!(Pallet::<Test>::process_checked_multi_dispute_data(
stmts
.into_iter()
.map(CheckedDisputeStatementSet::unchecked_from_unchecked)
.collect()
)
.is_err(),);
})
}

#[test]
fn test_freeze_on_note_included() {
new_test_ext(Default::default()).execute_with(|| {
Expand Down

0 comments on commit a5bff0c

Please sign in to comment.