dpp/state_transition/errors/
state_transition_error.rs1use crate::consensus::ConsensusError;
2use platform_value::Value;
3use platform_version::version::ProtocolVersion;
4use std::ops::RangeInclusive;
5use thiserror::Error;
6
7#[derive(Error, Debug)]
8pub enum StateTransitionError {
9 #[error("Invalid State Transition: {errors:?}")]
10 InvalidStateTransitionError {
11 errors: Vec<ConsensusError>,
12 raw_state_transition: Value,
13 },
14
15 #[error("The state transition of type '{state_transition_type}' is not active in the current protocol version {current_protocol_version}. For some state transitions this could be because of feature it contains. Active version range: {active_version_range:?}")]
16 StateTransitionIsNotActiveError {
17 state_transition_type: String,
18 active_version_range: RangeInclusive<ProtocolVersion>,
19 current_protocol_version: ProtocolVersion,
20 },
21}