Skip to content

Commit

Permalink
Standardize examples common
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-nillion committed Jun 21, 2024
1 parent 18936f8 commit 1c0266d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,13 @@ async def store_secret_value(
Returns:
str: Store ID.
"""
if nada_type in (na.Rational, na.SecretRational):
secret_value *= 2 ** na.get_log_scale()
if nada_type == na.Rational:
secret_value = round(secret_value * 2 ** na.get_log_scale())
nada_type = nillion.PublicVariableInteger
elif nada_type == na.SecretRational:
secret_value = round(secret_value * 2 ** na.get_log_scale())
nada_type = nillion.SecretInteger

secrets = nillion.Secrets({name: nada_type(secret_value)})
store_id = await store_secrets(
client,
Expand Down

0 comments on commit 1c0266d

Please sign in to comment.