dpp/errors/
dpp_init_error.rs

1use crate::version::FeatureVersion;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum DashPlatformProtocolInitError {
6    #[error(transparent)]
7    SchemaDeserializationError(serde_json::Error),
8    #[error("Loaded Schema is invalid: {0}")]
9    InvalidSchemaError(&'static str),
10    #[error("platform init unknown version on {method}, received: {received}")]
11    UnknownVersionMismatch {
12        /// method
13        method: String,
14        /// the allowed versions for this method
15        known_versions: Vec<FeatureVersion>,
16        /// requested core height
17        received: FeatureVersion,
18    },
19}
20
21impl From<serde_json::Error> for DashPlatformProtocolInitError {
22    fn from(error: serde_json::Error) -> Self {
23        Self::SchemaDeserializationError(error)
24    }
25}