Skip to content

Commit

Permalink
feature: remove deprecated exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Mar 19, 2024
1 parent 4d04600 commit 61af9e0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 77 deletions.
4 changes: 0 additions & 4 deletions ferveo-python/ferveo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
ValidatorMessage,
FerveoVariant,
ThresholdEncryptionError,
InvalidDkgStateToDeal,
InvalidDkgStateToAggregate,
InvalidDkgStateToVerify,
InvalidDkgStateToIngest,
DealerNotInValidatorSet,
UnknownDealer,
DuplicateDealer,
Expand Down
21 changes: 0 additions & 21 deletions ferveo-python/ferveo/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,6 @@ def decrypt_with_shared_secret(
class ThresholdEncryptionError(Exception):
pass

class InvalidDkgStateToDeal(Exception):
pass

class InvalidDkgStateToAggregate(Exception):
pass

class InvalidDkgStateToVerify(Exception):
pass

class InvalidDkgStateToIngest(Exception):
pass

class DealerNotInValidatorSet(Exception):
pass

Expand All @@ -182,12 +170,6 @@ class DuplicateDealer(Exception):
class InvalidPvssTranscript(Exception):
pass

class InsufficientTranscriptsForAggregate(Exception):
pass

class InvalidDkgPublicKey(Exception):
pass

class InsufficientValidators(Exception):
pass

Expand Down Expand Up @@ -221,9 +203,6 @@ class NoTranscriptsToAggregate(Exception):
class InvalidAggregateVerificationParameters(Exception):
pass

class UnknownValidator(Exception):
pass

class TooManyTranscripts(Exception):
pass

Expand Down
22 changes: 0 additions & 22 deletions ferveo/src/bindings_python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ impl From<FerveoPythonError> for PyErr {
Error::ThresholdEncryptionError(err) => {
ThresholdEncryptionError::new_err(err.to_string())
}
Error::InvalidDkgStateToDeal => {
InvalidDkgStateToDeal::new_err("")
}
Error::InvalidDkgStateToAggregate => {
InvalidDkgStateToAggregate::new_err("")
}
Error::InvalidDkgStateToVerify => {
InvalidDkgStateToVerify::new_err("")
}
Error::InvalidDkgStateToIngest => {
InvalidDkgStateToIngest::new_err("")
}
Error::DealerNotInValidatorSet(dealer) => {
DealerNotInValidatorSet::new_err(dealer.to_string())
}
Expand All @@ -61,13 +49,6 @@ impl From<FerveoPythonError> for PyErr {
Error::InvalidPvssTranscript(validator_addr) => {
InvalidPvssTranscript::new_err(validator_addr.to_string())
}
Error::InsufficientTranscriptsForAggregate(
expected,
actual,
) => InsufficientTranscriptsForAggregate::new_err(format!(
"expected: {expected}, actual: {actual}"
)),
Error::InvalidDkgPublicKey => InvalidDkgPublicKey::new_err(""),
Error::InsufficientValidators(expected, actual) => {
InsufficientValidators::new_err(format!(
"expected: {expected}, actual: {actual}"
Expand Down Expand Up @@ -121,9 +102,6 @@ impl From<FerveoPythonError> for PyErr {
"validators_num: {validators_num}, messages_num: {messages_num}"
))
},
Error::UnknownValidator(validator) => {
UnknownValidator::new_err(validator.to_string())
},
Error::TooManyTranscripts(expected, received) => {
TooManyTranscripts::new_err(format!(
"expected: {expected}, received: {received}"
Expand Down
30 changes: 0 additions & 30 deletions ferveo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@ pub enum Error {
#[error(transparent)]
ThresholdEncryptionError(#[from] ferveo_tdec::Error),

/// DKG is not in a valid state to deal PVSS shares
#[error("Invalid DKG state to deal PVSS shares")]
InvalidDkgStateToDeal,

/// DKG is not in a valid state to aggregate PVSS transcripts
#[error("Invalid DKG state to aggregate PVSS transcripts")]
InvalidDkgStateToAggregate,

/// DKG is not in a valid state to verify PVSS transcripts
#[error("Invalid DKG state to verify PVSS transcripts")]
InvalidDkgStateToVerify,

/// DKG is not in a valid state to ingest PVSS transcripts
#[error("Invalid DKG state to ingest PVSS transcripts")]
InvalidDkgStateToIngest,

/// DKG validator set must contain the validator with the given address
#[error("Expected validator to be a part of the DKG validator set: {0}")]
DealerNotInValidatorSet(EthereumAddress),
Expand All @@ -62,16 +46,6 @@ pub enum Error {
#[error("DKG received an invalid transcript from validator: {0}")]
InvalidPvssTranscript(EthereumAddress),

/// Aggregation failed because the DKG did not receive enough PVSS transcripts
#[error(
"Insufficient transcripts for aggregation (expected {0}, got {1})"
)]
InsufficientTranscriptsForAggregate(u32, u32),

/// Failed to derive a valid final key for the DKG
#[error("Failed to derive a valid final key for the DKG")]
InvalidDkgPublicKey,

/// Not enough validators to perform the DKG for a given number of shares
#[error("Not enough validators (expected {0}, got {1})")]
InsufficientValidators(u32, u32),
Expand Down Expand Up @@ -122,10 +96,6 @@ pub enum Error {
#[error("Invalid aggregate verification parameters: number of validators {0}, number of messages: {1}")]
InvalidAggregateVerificationParameters(u32, u32),

/// Validator not found in the DKG set of validators
#[error("Validator not found: {0}")]
UnknownValidator(EthereumAddress),

/// Too many transcripts received by the DKG
#[error("Too many transcripts. Expected: {0}, got: {1}")]
TooManyTranscripts(u32, u32),
Expand Down

0 comments on commit 61af9e0

Please sign in to comment.