From e8a3a23736b58dac879a4b548a5eaabc305ab114 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 25 May 2022 13:31:26 +0000 Subject: [PATCH] fix: create collection properties length --- --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -105,13 +105,9 @@ pub const MAX_PROPERTY_VALUE_LENGTH: u32 = 32768; pub const MAX_PROPERTIES_PER_ITEM: u32 = 64; -// pub const MAX_PROPERTY_KEYS_OVERALL_LENGTH: u32 = MAX_PROPERTY_KEY_LENGTH * MAX_PROPERTIES_PER_ITEM; pub const MAX_COLLECTION_PROPERTIES_SIZE: u32 = 40960; pub const MAX_TOKEN_PROPERTIES_SIZE: u32 = 32768; -pub const MAX_COLLECTION_PROPERTIES_ENCODE_LEN: u32 = - MAX_PROPERTIES_PER_ITEM * MAX_PROPERTY_KEY_LENGTH + MAX_COLLECTION_PROPERTIES_SIZE; - // RMRK constants pub const RMRK_STRING_LIMIT: u32 = 128; pub const RMRK_COLLECTION_SYMBOL_LIMIT: u32 = 100; @@ -119,15 +115,6 @@ pub const RMRK_KEY_LIMIT: u32 = 32; pub const RMRK_VALUE_LIMIT: u32 = 256; -pub struct MaxPropertiesPermissionsEncodeLen; - -impl Get for MaxPropertiesPermissionsEncodeLen { - fn get() -> u32 { - MAX_PROPERTIES_PER_ITEM * MAX_PROPERTY_KEY_LENGTH - + ::max_encoded_len() as u32 - } -} - /// How much items can be created per single /// create_many call pub const MAX_ITEMS_PER_BATCH: u32 = 200; @@ -381,10 +368,10 @@ } pub type CollectionPropertiesPermissionsVec = - BoundedVec; + BoundedVec>; pub type CollectionPropertiesVec = - BoundedVec>; + BoundedVec>; /// All fields are wrapped in `Option`s, where None means chain default #[struct_versioning::versioned(version = 2, upper)] -- gitstuff