git.delta.rocks / unique-network / refs/commits / f09c3184b618

difftreelog

fix sponsored_data rate limit optionality

Yaroslav Bolyukin2021-11-18parent: #b9a00d1.patch.diff
in: master

1 file changed

modifiedprimitives/nft/src/lib.rsdiffbeforeafterboth
248 pub variable_data: Vec<u8>,248 pub variable_data: Vec<u8>,
249}249}
250250
251/// All fields are wrapped in `Option`s, where None means chain default
251#[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 sponsored
257 /// Some(v) - setVariableMetadata is sponsored258 /// Some(v) - setVariableMetadata is sponsored
258 /// if there is v block between txs259 /// if there is v block between txs
259 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>,
261262
262 // Timeouts for item types in passed blocks263 // Timeouts for item types in passed blocks
304 }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_limit
308 .unwrap_or((None,))
309 .0
307 .map(|v| v.min(MAX_SPONSOR_TIMEOUT))310 .map(|v| v.min(MAX_SPONSOR_TIMEOUT))
308 }311 }
309}312}