Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RPC] Update with latest cryptol_client, fix types #1550

Merged
merged 12 commits into from Jan 4, 2022
Merged

Conversation

m-yac
Copy link
Contributor

@m-yac m-yac commented Dec 23, 2021

This PR updates the SAW RPC Python API with the latest version of the Cryptol RPC Python API. Summarizing the most relevant change, what was written before as:

cryptol("(@)")(res, cryptol("0"))
cryptol("`{i}:[64]".format(i=length))
i < cryptol("512")

would now be written as:

cry_f("{res}@0")
cry_f("`{length}:[64]")
cry_f("{i} < 512")

This PR also adds precondition_f, postcondition_f, and returns_f, which are just shorthands for precondition(cry_f(...)), postcondition(cry_f(...)), and returns(cry_f(...)). For example, what was written before as:

self.precondition(i < cryptol("512"))

would now be written as:

self.precondition_f("{i} < 512")

Additionally, this PR updates various parts of the library and tests to get everything to typecheck with mypy, and makes some types more explicit where possible.

@m-yac m-yac added the saw-remote-api Related to the RPC SAW server label Dec 23, 2021
@m-yac m-yac requested a review from pnwamk December 23, 2021 22:43
Copy link
Contributor

@pnwamk pnwamk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is awesome. Just a few minor comments I'm happy with you addressing however you see fit. (Happy to chat more about tradeoffs too, but don't feel blocked by me over something trivial.)

Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>
@m-yac m-yac added the ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully. label Jan 4, 2022
@mergify mergify bot merged commit f7a0de1 into master Jan 4, 2022
@mergify mergify bot deleted the rpc/quoted-cryptol branch January 4, 2022 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully. saw-remote-api Related to the RPC SAW server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants