state-res: Remove unused function parameters

This commit is contained in:
Jonas Platte 2021-09-04 10:35:42 +02:00
parent 17ffade52b
commit 290c61820b
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
5 changed files with 3 additions and 12 deletions

View File

@ -63,7 +63,6 @@ fn resolution_shallow_auth_chain(c: &mut Criterion) {
let ev_map: EventMap<Arc<StateEvent>> = store.0.clone();
let state_sets = vec![state_at_bob.clone(), state_at_charlie.clone()];
let _ = match state_res::resolve::<StateEvent, _>(
&room_id(),
&RoomVersionId::Version6,
&state_sets,
state_sets
@ -120,7 +119,6 @@ fn resolve_deeper_event_set(c: &mut Criterion) {
b.iter(|| {
let state_sets = vec![state_set_a.clone(), state_set_b.clone()];
let _ = match state_res::resolve::<StateEvent, _>(
&room_id(),
&RoomVersionId::Version6,
&state_sets,
state_sets

View File

@ -13,7 +13,7 @@ use ruma_events::{
},
EventType,
};
use ruma_identifiers::{EventId, RoomId, RoomVersionId};
use ruma_identifiers::{EventId, RoomVersionId};
use tracing::{debug, info, trace, warn};
mod error;
@ -53,7 +53,6 @@ pub type EventMap<T> = HashMap<EventId, T>;
/// The caller of `resolve` must ensure that all the events are from the same room. Although this
/// function takes a `RoomId` it does not check that each event is part of the same room.
pub fn resolve<E, F>(
room_id: &RoomId,
room_version: &RoomVersionId,
state_sets: &[StateMap<EventId>],
auth_chain_sets: Vec<HashSet<EventId>>,
@ -80,7 +79,7 @@ where
debug!("{:?}", conflicting);
// The set of auth events that are not common across server forks
let mut auth_diff = get_auth_chain_diff(room_id, auth_chain_sets)?;
let mut auth_diff = get_auth_chain_diff(auth_chain_sets)?;
// Add the auth_diff to conflicting now we have a full set of conflicting events
auth_diff.extend(conflicting.values().cloned().flatten().flatten());
@ -196,10 +195,7 @@ pub fn separate(
}
/// Returns a Vec of deduped EventIds that appear in some chains but not others.
pub fn get_auth_chain_diff(
_room_id: &RoomId,
auth_chain_sets: Vec<HashSet<EventId>>,
) -> Result<HashSet<EventId>> {
pub fn get_auth_chain_diff(auth_chain_sets: Vec<HashSet<EventId>>) -> Result<HashSet<EventId>> {
if let Some(first) = auth_chain_sets.first().cloned() {
let common = auth_chain_sets
.iter()

View File

@ -109,7 +109,6 @@ pub fn do_check(
);
let resolved = state_res::resolve(
&room_id(),
&RoomVersionId::Version6,
&state_sets,
state_sets

View File

@ -69,7 +69,6 @@ fn ban_with_auth_chains2() {
let ev_map: EventMap<Arc<StateEvent>> = store.0.clone();
let state_sets = vec![state_set_a, state_set_b];
let resolved = match state_res::resolve::<StateEvent, _>(
&room_id(),
&RoomVersionId::Version6,
&state_sets,
state_sets

View File

@ -262,7 +262,6 @@ fn test_event_map_none() {
let ev_map: EventMap<Arc<StateEvent>> = store.0.clone();
let state_sets = vec![state_at_bob, state_at_charlie];
let resolved = match state_res::resolve::<StateEvent, _>(
&room_id(),
&RoomVersionId::Version2,
&state_sets,
state_sets