Skip to content

Commit

Permalink
deprecate
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaos Dymitriadis <[email protected]>
  • Loading branch information
AmbientTea committed Feb 3, 2025
1 parent 0d197e6 commit 5cb1a2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
4 changes: 3 additions & 1 deletion toolkit/pallets/session-validator-management/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ pub mod pallet {

if *validators_param != validators {
if *call_selection_inputs_hash == computed_selection_inputs_hash {
return Err(InherentError::InvalidValidators(computed_selection_inputs_hash));
return Err(InherentError::InvalidValidatorsMatchingHash(
computed_selection_inputs_hash,
));
} else {
return Err(InherentError::InvalidValidatorsHashMismatch(
computed_selection_inputs_hash,
Expand Down
21 changes: 15 additions & 6 deletions toolkit/primitives/session-validator-management/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,32 @@ pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"/ariadne";
#[derive(Encode, sp_runtime::RuntimeDebug, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Decode, thiserror::Error))]
pub enum InherentError {
#[deprecated(
since = "1.5.0",
note = "Use InvalidValidatorsMatchingHash or InvalidValidatorsHashMismatch"
)]
#[cfg_attr(
feature = "std",
error("The validators in the block do not match the calculated validators")
)]
InvalidValidators,
#[cfg_attr(
feature = "std",
error("Candidates inherent required: committee needs to be stored one epoch in advance")
)]
CommitteeNeedsToBeStoredOneEpochInAdvance,
#[cfg_attr(
feature = "std",
error("The validators in the block do not match the calculated validators. Input data hash ({}) is valid.", .0.to_hex_string())
)]
InvalidValidators(SizedByteString<32>),
InvalidValidatorsMatchingHash(SizedByteString<32>),
#[cfg_attr(
feature = "std",
error("The validators and input data hash in the block do not match the calculated values. Expected hash: {}, got: {}",
.0.to_hex_string(),
.1.to_hex_string())
)]
InvalidValidatorsHashMismatch(SizedByteString<32>, SizedByteString<32>),
#[cfg_attr(
feature = "std",
error("Candidates inherent required: committee needs to be stored one epoch in advance")
)]
CommitteeNeedsToBeStoredOneEpochInAdvance,
}

impl IsFatalError for InherentError {
Expand Down

0 comments on commit 5cb1a2c

Please sign in to comment.