difftreelog
fix sponsored_data rate limit optionality
in: master
1 file changed
primitives/nft/src/lib.rsdiffbeforeafterboth248 pub variable_data: Vec<u8>,248 pub variable_data: Vec<u8>,249}249}250250251/// All fields are wrapped in `Option`s, where None means chain default251#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo)]252#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo)]252#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]253#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]253pub struct CollectionLimits {254pub struct CollectionLimits {256 /// None - setVariableMetadata is not sponsored257 /// None - setVariableMetadata is not sponsored257 /// Some(v) - setVariableMetadata is sponsored258 /// Some(v) - setVariableMetadata is sponsored258 /// if there is v block between txs259 /// if there is v block between txs259 pub sponsored_data_rate_limit: Option<u32>,260 pub sponsored_data_rate_limit: Option<(Option<u32>,)>,260 pub token_limit: Option<u32>,261 pub token_limit: Option<u32>,261262262 // Timeouts for item types in passed blocks263 // Timeouts for item types in passed blocks304 }305 }305 pub fn sponsored_data_rate_limit(&self) -> Option<u32> {306 pub fn sponsored_data_rate_limit(&self) -> Option<u32> {306 self.sponsored_data_rate_limit307 self.sponsored_data_rate_limit308 .unwrap_or((None,))309 .0307 .map(|v| v.min(MAX_SPONSOR_TIMEOUT))310 .map(|v| v.min(MAX_SPONSOR_TIMEOUT))308 }311 }309}312}