mirror of https://github.com/nucypher/nucypher.git
value/rate/reward passed through
parent
1731262308
commit
9d9cdb9df1
|
@ -77,13 +77,16 @@ class AliceInterface(CharacterPublicInterface, AliceSpecification):
|
|||
n: int,
|
||||
expiration: maya.MayaDT,
|
||||
value: int = None,
|
||||
first_period_reward: int = None
|
||||
) -> dict:
|
||||
|
||||
from nucypher.characters.lawful import Bob
|
||||
bob = Bob.from_public_keys(encrypting_key=bob_encrypting_key,
|
||||
verifying_key=bob_verifying_key)
|
||||
|
||||
new_policy = self.character.create_policy(bob=bob, label=label, m=m, n=n, value=value, expiration=expiration)
|
||||
new_policy = self.character.create_policy(
|
||||
bob=bob, label=label, m=m, n=n, expiration=expiration,
|
||||
value=value, first_period_reward=first_period_reward)
|
||||
response_data = {'label': new_policy.label, 'policy_encrypting_key': new_policy.public_key}
|
||||
return response_data
|
||||
|
||||
|
|
|
@ -87,6 +87,9 @@ class AliceControlJSONSerializer(CharacterControlJSONSerializer, MessageHandlerM
|
|||
m=request['m'],
|
||||
n=request['n'],
|
||||
expiration=maya.MayaDT.from_iso8601(iso8601_string=request['expiration']))
|
||||
for field in ('value', 'rate', 'first_period_reward'):
|
||||
if field in request:
|
||||
parsed_input[field] = request[field]
|
||||
return parsed_input
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -66,14 +66,14 @@ class CharacterSpecification(ABC):
|
|||
class AliceSpecification(CharacterSpecification):
|
||||
|
||||
__create_policy = {'in': ('bob_encrypting_key', 'bob_verifying_key', 'm', 'n', 'label', 'expiration'),
|
||||
'optional': ('value',),
|
||||
'optional': ('value', 'first_period_reward', 'rate'),
|
||||
'out': ('label', 'policy_encrypting_key')}
|
||||
|
||||
__derive_policy_encrypting_key = {'in': ('label', ),
|
||||
'out': ('policy_encrypting_key', 'label')}
|
||||
|
||||
__grant = {'in': ('bob_encrypting_key', 'bob_verifying_key', 'm', 'n', 'label', 'expiration'),
|
||||
'optional': ('value',),
|
||||
'optional': ('value', 'first_period_reward', 'rate'),
|
||||
'out': ('treasure_map', 'policy_encrypting_key', 'alice_verifying_key')}
|
||||
|
||||
__revoke = {'in': ('label', 'bob_verifying_key', ),
|
||||
|
|
Loading…
Reference in New Issue