1mod error;
2pub mod v1;
3
4pub use crate::error::Error;
5use platform_value::{Identifier, IdentifierBytes32};
6use platform_version::version::PlatformVersion;
7use serde_json::Value;
8
9pub const ID_BYTES: [u8; 32] = [
10 162, 161, 180, 172, 111, 239, 34, 234, 42, 26, 104, 232, 18, 54, 68, 179, 87, 135, 95, 107, 65,
11 44, 24, 16, 146, 129, 193, 70, 231, 178, 113, 188,
12];
13
14pub const OWNER_ID_BYTES: [u8; 32] = [0; 32];
15
16pub const ID: Identifier = Identifier(IdentifierBytes32(ID_BYTES));
17pub const OWNER_ID: Identifier = Identifier(IdentifierBytes32(OWNER_ID_BYTES));
18
19pub fn load_definitions(platform_version: &PlatformVersion) -> Result<Option<Value>, Error> {
20 match platform_version.system_data_contracts.dashpay {
21 1 => Ok(None),
22 version => Err(Error::UnknownVersionMismatch {
23 method: "dashpay_contract::load_definitions".to_string(),
24 known_versions: vec![1],
25 received: version,
26 }),
27 }
28}
29pub fn load_documents_schemas(platform_version: &PlatformVersion) -> Result<Value, Error> {
30 match platform_version.system_data_contracts.dashpay {
31 1 => v1::load_documents_schemas(),
32 version => Err(Error::UnknownVersionMismatch {
33 method: "dashpay_contract::load_documents_schemas".to_string(),
34 known_versions: vec![1],
35 received: version,
36 }),
37 }
38}