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

sender randomness type safety #196

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dan-da
Copy link
Collaborator

@dan-da dan-da commented Oct 1, 2024

addresses #195.

This PR is a quick n dirty prototype to demonstrate feasability/direction with this. I am making it a draft PR as it is low priority and should definitely wait until after other pending PRs are reviewed and merged in, etc.

It implements a macro digest_newtype!() that creates a new-type for Digest with all the impls.

The macro is used inside lib.rs like so:

crate::macros::digest_newtype!(SenderRandomness);

note: these newtypes should probably be in their own module.

The rest of the changes are just adapting the code to use SenderRandomness everywhere that previously expected Digest.

Future PRs could create newtypes for ReceiverPreImage, ReceiverPrivacyDigest, BlockDigest, and so on.

@dan-da dan-da force-pushed the danda/195_sender_randomness_type_safety branch from 8a906e9 to 758616d Compare October 1, 2024 21:29
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.

1 participant