common.receipts

create_appointment_receipt(user_signature, start_block)[source]

Creates an appointment receipt.

The receipt has the following format:

user_signature | start_block (4-byte)

All values are big endian.

Parameters
  • user_signature (str) – the signature of the appointment by the user.

  • start_block (int) – the block height at which the tower will start watching for the appointment.

Returns

The serialized data to be signed.

Return type

bytes

create_registration_receipt(user_id, available_slots, subscription_expiry)[source]

Creates a registration receipt.

The receipt has the following format:

user_id (33-byte) | available_slots (4-byte) | subscription_expiry (4-byte)

All values are big endian.

Parameters
  • user_id (str) – the public key that identifies the user (33-bytes hex str).

  • available_slots (int) – the number of slots assigned to a user subscription (4-byte unsigned int).

  • subscription_expiry (int) – the expiry assigned to a user subscription (4-byte unsigned int).

Returns

The serialized data to be signed.

Return type

bytes