From e56d3c6cb3939bfe9b10c5a18a62104f85a02fef Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 14 Jan 2025 05:56:06 +0000 Subject: [PATCH] add multi_get_statekey_from_short Signed-off-by: Jason Volk --- src/service/rooms/short/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/service/rooms/short/mod.rs b/src/service/rooms/short/mod.rs index b645f9f1..4a591592 100644 --- a/src/service/rooms/short/mod.rs +++ b/src/service/rooms/short/mod.rs @@ -196,6 +196,20 @@ pub async fn get_statekey_from_short( }) } +#[implement(Service)] +pub fn multi_get_statekey_from_short<'a, S>( + &'a self, + shortstatekey: S, +) -> impl Stream> + Send + 'a +where + S: Stream + Send + 'a, +{ + self.db + .shortstatekey_statekey + .qry_batch(shortstatekey) + .map(Deserialized::deserialized) +} + /// Returns (shortstatehash, already_existed) #[implement(Service)] pub async fn get_or_create_shortstatehash(&self, state_hash: &[u8]) -> (ShortStateHash, bool) {