Skip to content

Commit

Permalink
no test - no problem
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Jun 4, 2024
1 parent f5d78ff commit a22beac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 70 deletions.
65 changes: 0 additions & 65 deletions polkadot/runtime/parachains/src/disputes/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,71 +577,6 @@ fn test_disputes_with_missing_backing_votes_are_rejected() {
})
}

#[test]
fn test_freeze_on_note_included() {
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(6, |b| {
// a new session at each block
Some((
true,
b,
vec![(&0, v0.public()), (&1, v1.public())],
Some(vec![(&0, v0.public()), (&1, v1.public())]),
))
});

let candidate_hash = CandidateHash(sp_core::H256::repeat_byte(1));
let inclusion_parent = sp_core::H256::repeat_byte(0xff);
let session = 3;

// v0 votes for 3
let stmts = vec![DisputeStatementSet {
candidate_hash,
session: 3,
statements: vec![
(
DisputeStatement::Invalid(InvalidDisputeStatementKind::Explicit),
ValidatorIndex(0),
v0.sign(
&ExplicitDisputeStatement { valid: false, candidate_hash, session: 3 }
.signing_payload(),
),
),
(
DisputeStatement::Invalid(InvalidDisputeStatementKind::Explicit),
ValidatorIndex(1),
v1.sign(
&ExplicitDisputeStatement { valid: false, candidate_hash, session: 3 }
.signing_payload(),
),
),
(
DisputeStatement::Valid(ValidDisputeStatementKind::BackingValid(
inclusion_parent,
)),
ValidatorIndex(1),
v0.sign(&CompactStatement::Valid(candidate_hash).signing_payload(
&SigningContext { session_index: session, parent_hash: inclusion_parent },
)),
),
],
}];
assert!(Pallet::<Test>::process_checked_multi_dispute_data(
&stmts
.into_iter()
.map(CheckedDisputeStatementSet::unchecked_from_unchecked)
.collect()
)
.is_ok());

Pallet::<Test>::note_included(3, candidate_hash, 3);
assert_eq!(Frozen::<Test>::get(), Some(2));
});
}

#[test]
fn test_freeze_provided_against_supermajority_for_included() {
new_test_ext(Default::default()).execute_with(|| {
Expand Down
10 changes: 5 additions & 5 deletions polkadot/runtime/parachains/src/paras_inherent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,11 @@ impl<T: Config> Pallet<T> {

METRICS.on_after_filter(all_weight_after.ref_time());
log::debug!(
target: LOG_TARGET,
"[process_inherent_data] after filter: bitfields.len(): {}, backed_candidates.len(): {}, checked_disputes_sets.len() {}",
bitfields.len(),
backed_candidates.len(),
checked_disputes_sets.len()
target: LOG_TARGET,
"[process_inherent_data] after filter: bitfields.len(): {}, backed_candidates.len(): {}, checked_disputes_sets.len() {}",
bitfields.len(),
backed_candidates.len(),
checked_disputes_sets.len()
);
log::debug!(target: LOG_TARGET, "Size after filter: {}, candidates + bitfields: {}, disputes: {}", all_weight_after.proof_size(), non_disputes_weight.proof_size(), checked_disputes_sets_consumed_weight.proof_size());
log::debug!(target: LOG_TARGET, "Time weight after filter: {}, candidates + bitfields: {}, disputes: {}", all_weight_after.ref_time(), non_disputes_weight.ref_time(), checked_disputes_sets_consumed_weight.ref_time());
Expand Down

0 comments on commit a22beac

Please sign in to comment.