Refactor Specifications/Serializers#1555
Conversation
derekpierre
left a comment
There was a problem hiding this comment.
@vepkenez - marshmellow definitely provides some specification clarity.
Some questions/comments for you.
| n: int, | ||
| expiration: maya.MayaDT, | ||
| value: int = None, | ||
| first_period_reward: int = None, |
There was a problem hiding this comment.
Yes, I think this parameter got removed
There was a problem hiding this comment.
There was a problem hiding this comment.
#1459 is already merged into matster, so if this PR is currently based over the latest, and this variable is unused within this function it can be safely removed.
nucypher/characters/control/specifications/fields/messagekit.py
Outdated
Show resolved
Hide resolved
7a84aa8 to
8c0600e
Compare
| def get_serializer(self, interface_name: str): | ||
| return self.specification.get_serializer(inteface_name) | ||
|
|
||
| def _perform_action(self, action: str, request: dict) -> dict: |
nucypher/characters/control/specifications/fields/messagekit.py
Outdated
Show resolved
Hide resolved
761105a to
e540f89
Compare
derekpierre
left a comment
There was a problem hiding this comment.
Unsure how I feel about the CLI integration - a bit of indirection - need to think a bit more about it.
Seems like we need some more tests...?
| def _deserialize(self, value, attr, data, **kwargs): | ||
| return b64decode(value) | ||
|
|
||
| def _validate(self, value): |
There was a problem hiding this comment.
Can validate here simply be (?)
try:
treasure_map = TreasureMap.from_bytes(value):
return True
except:
return FalseI'm unsure whether the verify kwarg for from_bytes can remain as True (default) or needs to be set to False.
There was a problem hiding this comment.
Yes, I'd love it if that worked but unfortunately importing nucypher.policy.collections.Treasuremap causes a circular import since Bob is imported into that same file... which I think should maybe be a TODO but maybe there is some reason I'm not aware of.
I agree @derekpierre. It's not ideal. It was better before the cleanup-options PR. I think in the long run, the path is going to be to remove some of the complexity and have all of the CLI options be specified through similar schemas so it will actually be very simple. so instead of we'll have And then the click stuff would be generated from that. @KPrasch and I are planning to expand this concept to move most of the ad-hoc code that lives in the cli files into interfaces that can then be accessed through any entry point... but later. |
6d59811 to
e449341
Compare
handle TypeError in invalid RPC input
fix double encode
address RFCs
…ilaizers with schema modeling (Needs adiitional follow up).
…ication API (successful policy creation by RPC controller)
fix rpc_control_blockchain test
remove specifications references remove bad idea
rename 'connect' to 'connect_cli'
rebuilt reqs
fix scoping issue
Co-Authored-By: Derek Pierre <derek.pierre@gmail.com> Co-Authored-By: Derek Pierre <derek.pierre@gmail.com>
3c5d1a8 to
d656142
Compare
|
I agree with @cygnusv that some commits can probably be squashed for a cleaner history. |
7531d5e to
0a0761e
Compare
Uh oh!
There was an error while loading. Please reload this page.