AleoNet / aleo-setup

A Setup Ceremony for Universal SNARKs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace Participant enum with two distinct structures

ibaryshnikov opened this issue · comments

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.

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