52 Commits

Author SHA1 Message Date
Jonas Platte
04080085f9
events: Include all event type segments in Rust type names 2021-10-02 21:25:21 +02:00
Jonas Platte
de2b415020
state-res: Silence buggy clippy lint 2021-09-30 21:49:39 +02:00
Amanda Graven
3b5f3cb5a6
events: Move JoinRulesEventContent.allow into JoinRules 2021-09-28 13:39:58 +00:00
Jonas Platte
a9985d7763
events / state-res: Use RawJsonValue over JsonValue for event content 2021-09-15 20:58:42 +02:00
Jonas Platte
c94f9d5c88
state-res: Remove unnecessary .iter() call 2021-09-14 10:14:51 +02:00
Jonas Platte
a6a1224652
state-res: Make functions more general
Don't require different parameters to use the same impl Event.
2021-09-13 19:02:36 +02:00
Jonas Platte
0999e420ae
state-res: Return borrowed content in Event method 2021-09-13 19:02:36 +02:00
Jonas Platte
889406b6c2
state-res: Make resolve more general by using impl IntoIterator for state_sets 2021-09-13 19:02:36 +02:00
Jonas Platte
3830dcddc2
state-res: Simplify tests a bit 2021-09-13 19:02:36 +02:00
Jonas Platte
f566cd4486
state-res: Remove unneeded rebuilding of collection for logging 2021-09-13 19:02:36 +02:00
Jonas Platte
118aa8fc4a
state-res: Make usage of Arc optional 2021-09-13 19:02:36 +02:00
Jonas Platte
f0cd82dae7
state-res: Refactor test_utils 2021-09-13 19:02:36 +02:00
Jonas Platte
279322862c
state-res: Reduce public API to what Conduit uses 2021-09-13 19:02:36 +02:00
Jonas Platte
3c0493bddf
state-res: Move tests into the crate and make test_utils private 2021-09-13 19:02:36 +02:00
Jonas Platte
d60b7bf814
state-res: Filter out Nones from conflicted_state earlier 2021-09-13 19:02:35 +02:00
Jonas Platte
b31065827b
state-res: Allocate less when computing all_conflicted 2021-09-13 19:02:35 +02:00
Jonas Platte
6559681095
state-res: Rewrite get_auth_chain_diff algorithm 2021-09-13 19:02:35 +02:00
Jonas Platte
00a59d0528
state-res: Reduce unnecessary Arc usage 2021-09-13 19:02:35 +02:00
Jonas Platte
0ed0a620a3
state-res: Refactor iterative_auth_check 2021-09-13 19:02:35 +02:00
Jonas Platte
1e19de9579
state-res: Return borrows from Event::{prev_events, auth_events} 2021-09-13 19:02:35 +02:00
Jonas Platte
34a10b87c5
state-res: Return borrows from Event::{event_type, state_key} 2021-09-13 19:02:35 +02:00
Jonas Platte
660cd97962
state-res: Remove todo comment
EventId has the same ordering as str.
2021-09-13 19:02:35 +02:00
Jonas Platte
91e6a1c65c
state-res: Use HashSet::retain 2021-09-13 19:02:35 +02:00
Jonas Platte
324fb58a62
state-res: Simplify get_auth_chain_diff signature
It never returned Err(_), so the return type shouldn't be Result<_>.
2021-09-13 19:02:35 +02:00
Jonas Platte
290c61820b
state-res: Remove unused function parameters 2021-09-13 19:02:35 +02:00
Jonas Platte
0a93780e83
state-res: Move tests/utils.rs to src/test_utils.rs 2021-09-13 19:02:34 +02:00
Jonas Platte
76fa15f248
state-res: Rename Event::kind to event_type 2021-09-13 19:02:33 +02:00
Jonas Platte
4bea59caef
state-res: Remove StateResolution type
… making its associated functions free instead.
2021-09-13 19:02:33 +02:00
Jonas Platte
cc9336e444
state-res: Take ownership of events to sort in reverse_topological_power_sort
Avoids clones.
2021-09-13 19:02:33 +02:00
Jonas Platte
815fd19a33
state-res: Remove pointless shifting around of Vec elements 2021-08-31 20:40:36 +02:00
Jonas Platte
9c5b2e3d8c
state-res: Only depend on maplit for tests / benches 2021-08-31 19:19:17 +02:00
Jonas Platte
a3707b1a3a
state-res: Remove pointless .unwrap() 2021-08-31 19:02:03 +02:00
Devin Ragotzy
886c33eac3
state-res: Use fetch state closure instead of auth_chain 2021-08-26 12:29:33 +02:00
Devin Ragotzy
b7d0970335
state-res: Remove dead code and stale comments 2021-08-10 15:22:47 +02:00
Devin Ragotzy
318f3186ad
state-res: Replace unwraps with expect or errors 2021-08-10 15:22:47 +02:00
Devin Ragotzy
01515aea41
state-res: Fix clippy warnings 2021-08-10 15:22:47 +02:00
Timo Kösters
3a0ee7740f
state-res: Change BTreeMap/Set to HashMap/Set 2021-08-10 15:22:47 +02:00
Timo Kösters
d970501c85
state-res: Revert calculating the auth chain in ruma
In a previous commit I moved the auth chain calculation code to ruma
because I thought I could optimize it by only taking auth chains from
conflicted events instead of all events. It turned out that was wrong
and now I removed that algorithm again (the full auth chains are now
passed in as an argument to state_res::resolve again).
2021-08-10 15:22:47 +02:00
Timo Kösters
17afbabd92
state-res: Calculate auth_events and fix bug when calculating common events 2021-08-10 15:22:46 +02:00
Devin Ragotzy
b8c54d8e2b
state-res: Pass fetch_event closure as owned F not &F 2021-08-10 15:22:46 +02:00
Devin Ragotzy
a4e6cc7c42
state-res: Use closure to fetch unknown events during state-res
state-res: Remove event_map arg from all functions

state-res: Remove get_or_load_event helper func and fix resolve docs
2021-08-10 15:22:26 +02:00
Devin Ragotzy
fae5385753 state-res: Make all pub structs non_exhaustive 2021-06-18 20:53:06 +02:00
Jonas Platte
e622803679
Use bool::then to simplify some code 2021-06-17 19:43:22 +02:00
Devin Ragotzy
ce6fd1e65e
state-res: Use unique over dedup, remove Vec -> BTreeSet conversions 2021-06-17 19:43:21 +02:00
Amanda Graven
97937d384c Typo corrections
The "comforming" typo in the function name at
crates/ruma-identifiers-validation/src/user_id.rs:22:26
was not corrected as that would be a breaking change.
2021-06-01 12:45:34 +02:00
Devin Ragotzy
9d0cdb8c0e
state-res: Make comments consistent and remove nested ifs 2021-05-19 17:25:28 +02:00
Jonas Platte
5710d2740c
Replace uses of SystemTime with new UInt-based timestamp types 2021-05-14 01:13:17 +02:00
Jonas Platte
71686ce8a4
state-res: Re-export RoomVersion from crate root 2021-05-08 01:34:27 +02:00
Jonas Platte
9263d0c949
state-res: Switch from log to tracing 2021-05-08 01:02:42 +02:00
Jonas Platte
f58462a002
state-res: Depend on ruma-* subcrates instead of ruma 2021-05-08 00:52:50 +02:00