Skip to content

Commit

Permalink
python: Define __all__
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Jul 4, 2024
1 parent c38442d commit 2eac2e8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions python/chilldkg_ref/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__all__ = ['chilldkg']
34 changes: 30 additions & 4 deletions python/chilldkg_ref/chilldkg.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Reference implementation of ChillDKG.
The public API consists of all functions with docstrings, including the types in
their arguments and return values, and the exceptions they raise). All other
definitions are internal.
their arguments and return values, and the exceptions they raise; see also the
`__all__` list. All other definitions are internal.
"""

from secrets import token_bytes as random_bytes
Expand All @@ -26,8 +26,34 @@
SessionNotFinalizedError,
)

# TODO
# __all__ = []
__all__ = [
# Functions
'hostpubkey',
'session_params',
'participant_step1',
'participant_step2',
'participant_finalize',
'coordinator_step',
'coordinator_finalize',
'recover',
# Exceptions
'InvalidContributionError',
'InvalidRecoveryDataError',
'DeserializationError',
'DuplicateHostpubkeyError',
'SessionNotFinalizedError',
# Types
'SessionParams',
'DKGOutput',
'ParticipantMsg1',
'ParticipantMsg2',
'ParticipantState1',
'ParticipantState2',
'CoordinatorMsg1',
'CoordinatorMsg2',
'CoordinatorState',
'RecoveryData',
]

# TODO Document in all public functions what exceptions they can raise

Expand Down

0 comments on commit 2eac2e8

Please sign in to comment.