use crate::{new_hash_type, new_key_type, new_vec_type, FixedVec};
use bounded_collections::ConstU32;
pub use config::*;
#[cfg(not(feature = "tiny"))]
mod config {
pub const VAL_COUNT: super::ValIndex = 1023;
pub const CHUNK_POINTS: usize = 342;
pub const CHUNKS_PER_SEGMENT: usize = 6;
}
#[cfg(feature = "tiny")]
mod config {
pub const VAL_COUNT: super::ValIndex = 6;
pub const CHUNK_POINTS: usize = 2;
pub const CHUNKS_PER_SEGMENT: usize = 32;
}
pub const POINT_LEN: usize = 2;
pub const SEGMENT_SLICE_LEN: usize = CHUNKS_PER_SEGMENT * POINT_LEN;
pub const CHUNK_LEN: usize = CHUNK_POINTS * POINT_LEN;
pub const SEGMENT_LEN: usize = CHUNK_LEN * CHUNKS_PER_SEGMENT;
pub const VAL_SUPER_MAJORITY: u32 = VAL_COUNT as u32 / 3 * 2 + 1;
pub const MAX_WORK_ITEMS: u32 = 4;
pub const MAX_IMPORTS: u32 = 2048;
pub const MAX_EXPORTS: u32 = 2048;
pub const MAX_DEPENDENCIES: usize = 8;
pub const MAX_INPUT: u32 = 12 * 1024 * 1024;
pub const MEMO_LEN: usize = 64;
pub const AUTH_QUEUE_LEN: usize = 80;
pub type Slot = u32;
pub type ValIndex = u16;
pub type CoreIndex = u16;
pub type ServiceId = u32;
pub type Balance = u64;
pub type DoubleBalance = u128;
pub type Gas = i64;
pub type DoubleGas = u128;
pub type Hash = [u8; 32];
new_hash_type!(HeaderHash);
new_hash_type!(CodeHash);
new_hash_type!(WorkPackageHash);
new_hash_type!(WorkReportHash);
new_hash_type!(PayloadHash);
new_hash_type!(StateRootHash);
new_hash_type!(MmrPeakHash);
new_hash_type!(AccumulateRootHash);
new_hash_type!(ExtrinsicHash);
new_hash_type!(ItemHash);
new_hash_type!(AuthorizerHash);
new_hash_type!(SegmentTreeRoot);
new_hash_type!(SegmentHash);
new_hash_type!(MerkleNodeHash);
new_hash_type!(AnyHash);
new_vec_type!(Authorization);
new_vec_type!(Code);
new_vec_type!(WorkPayload);
new_vec_type!(AuthParam);
new_vec_type!(AnyVec);
new_vec_type!(WorkOutput);
new_vec_type!(AuthOutput);
new_vec_type!(Bundle);
new_key_type!(Memo, MEMO_LEN);
new_key_type!(OpaqueEd25519Public, 32);
new_key_type!(OpaqueBandersnatchPublic, 32);
new_key_type!(OpaqueValidatorMetadata, 64);
pub type AuthQueue = FixedVec<AuthorizerHash, ConstU32<{ AUTH_QUEUE_LEN as u32 }>>;
pub type Segment = FixedVec<u8, ConstU32<{ SEGMENT_LEN as u32 }>>;