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

Replace Participant enum with two distinct structures #416

Open
ibaryshnikov opened this issue Sep 30, 2021 · 1 comment
Open

Replace Participant enum with two distinct structures #416

ibaryshnikov opened this issue Sep 30, 2021 · 1 comment
Labels
2 moderate priority enhancement New feature or request

Comments

@ibaryshnikov
Copy link

Initially many functions were dealing with both verifier and contributor at the same time. But after some time these roles have diverged, and most of the functions start with the check like this:

if participant.is_verifier() {
     return Err(CoordinatorError::ExpectedContributor);
}

Having two distinct structures instead of an enum will allow to catch many errors in compile time rather than in runtime. It will also reduce the size of many functions, which improves the maintenance.

@ibaryshnikov ibaryshnikov added enhancement New feature or request 2 moderate priority labels Sep 30, 2021
@ibaryshnikov ibaryshnikov added this to the Phase II Setup milestone Sep 30, 2021
@ibaryshnikov
Copy link
Author

There's a similar issue with an alternative approach
#245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 moderate priority enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant