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

Add conversion Praos to PraosBatchCompat #344

Merged
merged 10 commits into from
Feb 8, 2023

Conversation

iquerejeta
Copy link
Collaborator

@iquerejeta iquerejeta commented Nov 21, 2022

Some of the new BatchCompat VRF types are compatible with the existing Praos types. In this PR we create conversion functions, to allow for a smooth transition between the compatible types.

In particular, we create the following conversion functions:

  • skToBatchCompat :: SignKeyVRF PraosVRF -> SignKeyVRF BC.PraosBatchCompatVRF
  • vkToBatchCompat :: VerKeyVRF PraosVRF -> VerKeyVRF BC.PraosBatchCompatVRF
  • outputToBatchCompat :: OutputVRF PraosVRF -> OutputVRF BC.PraosBatchCompatVRF

We include tests to guarantee the compatibility of these converted types.

This closes #345

@iquerejeta iquerejeta marked this pull request as ready for review November 28, 2022 09:15
cardano-crypto-praos/src/Cardano/Crypto/VRF/Praos.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
@iquerejeta iquerejeta force-pushed the iquerejeta/type-conversions branch from cb0dff2 to 146ecd0 Compare November 29, 2022 11:40
@iquerejeta iquerejeta force-pushed the iquerejeta/type-conversions branch from 146ecd0 to b41a5fa Compare December 30, 2022 08:36
@iquerejeta iquerejeta force-pushed the update-vrf branch 3 times, most recently from e62d4c1 to 73a9eb4 Compare January 4, 2023 15:39
@iquerejeta iquerejeta force-pushed the update-vrf branch 2 times, most recently from 4c5bfde to 30f69ed Compare January 25, 2023 10:49
@iquerejeta iquerejeta changed the base branch from update-vrf to master January 25, 2023 16:28
@iquerejeta iquerejeta force-pushed the iquerejeta/type-conversions branch 2 times, most recently from 876563e to 696b301 Compare January 30, 2023 08:59
@iquerejeta iquerejeta requested a review from tdammers January 30, 2023 13:22
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Looks good. A couple of minor suggestions

cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-praos/src/Cardano/Crypto/VRF/Praos.hs Outdated Show resolved Hide resolved
cardano-crypto-praos/src/Cardano/Crypto/VRF/Praos.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
@iquerejeta iquerejeta force-pushed the iquerejeta/type-conversions branch from f2166d8 to 9ad1983 Compare February 1, 2023 09:02
Copy link
Contributor

@tdammers tdammers left a comment

Choose a reason for hiding this comment

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

Looks fine by me, none of the remarks are blockers.

cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Show resolved Hide resolved
Copy link
Contributor

@tdammers tdammers left a comment

Choose a reason for hiding this comment

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

Looks good to me, except for those parentheses.

cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
@iquerejeta iquerejeta force-pushed the iquerejeta/type-conversions branch from dbd0e36 to d264b45 Compare February 7, 2023 07:57
@iquerejeta iquerejeta requested a review from tdammers February 7, 2023 09:42
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

LGTM

@iquerejeta iquerejeta force-pushed the iquerejeta/type-conversions branch from d264b45 to c4b1790 Compare February 7, 2023 10:24
@iquerejeta iquerejeta merged commit b05fbc7 into master Feb 8, 2023
@iquerejeta iquerejeta deleted the iquerejeta/type-conversions branch February 8, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a conversion function from Praos to PraosBatchCompat types
3 participants