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

Commit

Permalink
Address Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Lldenaurois committed Dec 14, 2021
1 parent 690b171 commit 4939be0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
2 changes: 0 additions & 2 deletions node/core/approval-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,6 @@ impl ApprovalState {
}

struct CurrentlyCheckingSet {
/// Invariant: The contained `Vec` needs to stay sorted as we are using `binary_search_by_key`
/// on it.
candidate_hash_map: HashMap<CandidateHash, HashSet<Hash>>,
currently_checking: FuturesUnordered<BoxFuture<'static, ApprovalState>>,
}
Expand Down
19 changes: 4 additions & 15 deletions node/core/approval-voting/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ fn subsystem_validate_approvals_cache() {
let block_hash = Hash::repeat_byte(0x01);
let fork_block_hash = Hash::repeat_byte(0x02);
let candidate_commitments = CandidateCommitments::default();
let mut candidate_receipt = CandidateReceipt::<Hash>::default();
let mut candidate_receipt = dummy_candidate_receipt(block_hash);
candidate_receipt.commitments_hash = candidate_commitments.hash();
let candidate_hash = candidate_receipt.hash();
let slot = Slot::from(1);
Expand Down Expand Up @@ -2225,30 +2225,19 @@ fn subsystem_validate_approvals_cache() {
no_show_slots: 2,
};

let candidates = Some(vec![(candidate_receipt.clone(), CoreIndex(0), GroupIndex(0))]);
ChainBuilder::new()
.add_block(
block_hash,
ChainBuilder::GENESIS_HASH,
1,
BlockConfig {
slot,
candidates: Some(vec![(
candidate_receipt.clone(),
CoreIndex(0),
GroupIndex(0),
)]),
session_info: Some(session_info.clone()),
},
BlockConfig { slot, candidates, session_info: Some(session_info.clone()) },
)
.add_block(
fork_block_hash,
ChainBuilder::GENESIS_HASH,
1,
BlockConfig {
slot,
candidates: Some(vec![(candidate_receipt, CoreIndex(0), GroupIndex(0))]),
session_info: Some(session_info),
},
BlockConfig { slot, candidates, session_info: Some(session_info) },
)
.build(&mut virtual_overseer)
.await;
Expand Down

0 comments on commit 4939be0

Please sign in to comment.