mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:26:09 -04:00
Begin converting things to use the new Event structure
This commit is contained in:
parent
75b4329aaa
commit
5d7c9ab789
8 changed files with 96 additions and 39 deletions
|
@ -15,6 +15,8 @@
|
|||
|
||||
from _base import SQLBaseStore
|
||||
|
||||
from syutil.base64util import encode_base64
|
||||
|
||||
|
||||
class SignatureStore(SQLBaseStore):
|
||||
"""Persistence for event signatures and hashes"""
|
||||
|
@ -67,6 +69,20 @@ class SignatureStore(SQLBaseStore):
|
|||
f
|
||||
)
|
||||
|
||||
def add_event_hashes(self, event_ids):
|
||||
hashes = yield self.store.get_event_reference_hashes(
|
||||
event_ids
|
||||
)
|
||||
hashes = [
|
||||
{
|
||||
k: encode_base64(v) for k, v in h.items()
|
||||
if k == "sha256"
|
||||
}
|
||||
for h in hashes
|
||||
]
|
||||
|
||||
defer.returnValue(zip(event_ids, hashes))
|
||||
|
||||
def _get_event_reference_hashes_txn(self, txn, event_id):
|
||||
"""Get all the hashes for a given PDU.
|
||||
Args:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue