Skip to content

Commit

Permalink
Push API fingerprints added.
Browse files Browse the repository at this point in the history
  • Loading branch information
smelamud committed Aug 28, 2024
1 parent ba7cc1f commit 6092f99
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/moeralib/node/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,36 @@ def create_posting_fingerprint0(
return fingerprint_bytes({'version': 0, 'object_type': 'POSTING'} | locals(), POSTING_FINGERPRINT0_SCHEMA)


PUSH_RELAY_MESSAGE_FINGERPRINT0_SCHEMA: FingerprintSchema = [
('version', 'number'),
('object_type', 'string'),
('signed_at', 'number'),
]


def create_push_relay_message_fingerprint0(signed_at: Timestamp | None) -> bytes:
return fingerprint_bytes(
{'version': 0, 'object_type': 'PUSH_RELAY_MESSAGE'} | locals(), PUSH_RELAY_MESSAGE_FINGERPRINT0_SCHEMA
)


PUSH_RELAY_REGISTER_FINGERPRINT0_SCHEMA: FingerprintSchema = [
('version', 'number'),
('object_type', 'string'),
('client_id', 'string'),
('lang', 'string'),
('signed_at', 'number'),
]


def create_push_relay_register_fingerprint0(
client_id: str | None, lang: str | None, signed_at: Timestamp | None
) -> bytes:
return fingerprint_bytes(
{'version': 0, 'object_type': 'PUSH_RELAY_REGISTER'} | locals(), PUSH_RELAY_REGISTER_FINGERPRINT0_SCHEMA
)


REACTION_FINGERPRINT0_SCHEMA: FingerprintSchema = [
('version', 'number'),
('object_type', 'string'),
Expand Down

0 comments on commit 6092f99

Please sign in to comment.