add multi_get_statekey_from_short
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
afcd0bfeef
commit
e56d3c6cb3
1 changed files with 14 additions and 0 deletions
|
@ -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<Item = Result<(StateEventType, String)>> + Send + 'a
|
||||||
|
where
|
||||||
|
S: Stream<Item = ShortStateKey> + Send + 'a,
|
||||||
|
{
|
||||||
|
self.db
|
||||||
|
.shortstatekey_statekey
|
||||||
|
.qry_batch(shortstatekey)
|
||||||
|
.map(Deserialized::deserialized)
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns (shortstatehash, already_existed)
|
/// Returns (shortstatehash, already_existed)
|
||||||
#[implement(Service)]
|
#[implement(Service)]
|
||||||
pub async fn get_or_create_shortstatehash(&self, state_hash: &[u8]) -> (ShortStateHash, bool) {
|
pub async fn get_or_create_shortstatehash(&self, state_hash: &[u8]) -> (ShortStateHash, bool) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue