feature_flags_contract/
lib.rs1mod 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 245, 172, 216, 200, 193, 110, 185, 172, 40, 110, 7, 132, 190, 86, 127, 80, 9, 244, 86, 26, 243,
11 212, 255, 2, 91, 7, 90, 243, 68, 55, 152, 34,
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.withdrawals {
21 1 => Ok(None),
22 version => Err(Error::UnknownVersionMismatch {
23 method: "feature_flags_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.withdrawals {
31 1 => v1::load_documents_schemas(),
32 version => Err(Error::UnknownVersionMismatch {
33 method: "feature_flags_contract::load_documents_schemas".to_string(),
34 known_versions: vec![1],
35 received: version,
36 }),
37 }
38}