Update tests to new StateEvent using Pdu::RoomV3Pdu

This commit is contained in:
Devin Ragotzy 2020-11-01 18:48:23 -05:00
parent 6661771b31
commit ac4ab7ac06
4 changed files with 23 additions and 70 deletions

View File

@ -2,7 +2,6 @@ use std::{collections::BTreeMap, convert::TryFrom, sync::Arc};
use ruma::{
events::{
pdu::EventHash,
room::{
join_rules::JoinRule,
member::{MemberEventContent, MembershipState},
@ -110,27 +109,27 @@ where
.iter()
.map(AsRef::as_ref)
.map(event_id)
.map(|id| {
(
id,
EventHash {
sha256: "hello".into(),
},
)
})
// .map(|id| {
// (
// id,
// EventHash {
// sha256: "hello".into(),
// },
// )
// })
.collect::<Vec<_>>();
let prev_events = prev_events
.iter()
.map(AsRef::as_ref)
.map(event_id)
.map(|id| {
(
id,
EventHash {
sha256: "hello".into(),
},
)
})
// .map(|id| {
// (
// id,
// EventHash {
// sha256: "hello".into(),
// },
// )
// })
.collect::<Vec<_>>();
let json = if let Some(state_key) = state_key {

View File

@ -2,7 +2,6 @@ use std::{collections::BTreeMap, convert::TryFrom, sync::Arc};
use ruma::{
events::{
pdu::EventHash,
room::{
join_rules::JoinRule,
member::{MemberEventContent, MembershipState},
@ -92,27 +91,11 @@ where
.iter()
.map(AsRef::as_ref)
.map(event_id)
.map(|id| {
(
id,
EventHash {
sha256: "hello".into(),
},
)
})
.collect::<Vec<_>>();
let prev_events = prev_events
.iter()
.map(AsRef::as_ref)
.map(event_id)
.map(|id| {
(
id,
EventHash {
sha256: "hello".into(),
},
)
})
.collect::<Vec<_>>();
let json = if let Some(state_key) = state_key {

View File

@ -1,10 +1,14 @@
#![allow(clippy::or_fun_call, clippy::expect_fun_call)]
use std::{collections::BTreeMap, convert::TryFrom, sync::Arc, sync::Once, time::UNIX_EPOCH};
use std::{
collections::BTreeMap,
convert::TryFrom,
sync::{Arc, Once},
time::UNIX_EPOCH,
};
use ruma::{
events::{
pdu::EventHash,
room::{
join_rules::JoinRule,
member::{MemberEventContent, MembershipState},
@ -278,27 +282,11 @@ where
.iter()
.map(AsRef::as_ref)
.map(event_id)
.map(|id| {
(
id,
EventHash {
sha256: "hello".into(),
},
)
})
.collect::<Vec<_>>();
let prev_events = prev_events
.iter()
.map(AsRef::as_ref)
.map(event_id)
.map(|id| {
(
id,
EventHash {
sha256: "hello".into(),
},
)
})
.collect::<Vec<_>>();
let json = if let Some(state_key) = state_key {

View File

@ -3,7 +3,6 @@ use std::{collections::BTreeMap, convert::TryFrom, sync::Arc, time::UNIX_EPOCH};
use maplit::btreemap;
use ruma::{
events::{
pdu::EventHash,
room::{
join_rules::JoinRule,
member::{MemberEventContent, MembershipState},
@ -97,27 +96,11 @@ where
.iter()
.map(AsRef::as_ref)
.map(event_id)
.map(|id| {
(
id,
EventHash {
sha256: "hello".into(),
},
)
})
.collect::<Vec<_>>();
let prev_events = prev_events
.iter()
.map(AsRef::as_ref)
.map(event_id)
.map(|id| {
(
id,
EventHash {
sha256: "hello".into(),
},
)
})
.collect::<Vec<_>>();
let json = if let Some(state_key) = state_key {
@ -496,7 +479,7 @@ fn ban_vs_power_level() {
let edges = vec![
vec!["END", "MB", "MA", "PA", "START"],
vec!["END", "PB", "PA"],
vec!["END", "PA", "PB"],
]
.into_iter()
.map(|list| list.into_iter().map(event_id).collect::<Vec<_>>())