dpp/errors/consensus/state/data_trigger/
mod.rs

1use crate::consensus::state::data_trigger::data_trigger_condition_error::DataTriggerConditionError;
2use crate::consensus::state::data_trigger::data_trigger_execution_error::DataTriggerExecutionError;
3use crate::consensus::state::data_trigger::data_trigger_invalid_result_error::DataTriggerInvalidResultError;
4use crate::consensus::state::state_error::StateError;
5use crate::consensus::ConsensusError;
6use crate::errors::ProtocolError;
7use bincode::{Decode, Encode};
8use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize};
9use thiserror::Error;
10
11pub mod data_trigger_condition_error;
12pub mod data_trigger_execution_error;
13pub mod data_trigger_invalid_result_error;
14
15#[derive(
16    Error, Debug, PartialEq, Encode, Decode, PlatformSerialize, PlatformDeserialize, Clone,
17)]
18pub enum DataTriggerError {
19    /*
20
21    DO NOT CHANGE ORDER OF VARIANTS WITHOUT INTRODUCING OF NEW VERSION
22
23    */
24    #[error(transparent)]
25    DataTriggerConditionError(DataTriggerConditionError),
26
27    #[error(transparent)]
28    DataTriggerExecutionError(DataTriggerExecutionError),
29
30    #[error(transparent)]
31    DataTriggerInvalidResultError(DataTriggerInvalidResultError),
32}
33
34impl From<DataTriggerError> for ConsensusError {
35    fn from(error: DataTriggerError) -> Self {
36        Self::StateError(StateError::DataTriggerError(error))
37    }
38}