git.delta.rocks / unique-network / refs/commits / 62800e372218

difftreelog

refactor unused method has been deleted, added doc for `setCollectionLimit`.

PraetorP2022-12-15parent: #f0b63d0.patch.diff
in: master

1 file changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
412 /// "ownerCanTransfer",412 /// "ownerCanTransfer",
413 /// "ownerCanDestroy",413 /// "ownerCanDestroy",
414 /// "transfersEnabled"414 /// "transfersEnabled"
415 /// @param status enable\disable limit. Works only with `true`.
415 /// @param value Value of the limit.416 /// @param value Value of the limit.
416 #[solidity(rename_selector = "setCollectionLimit")]417 #[solidity(rename_selector = "setCollectionLimit")]
417 fn set_collection_limit(418 fn set_collection_limit(
885 }886 }
886}887}
887
888fn convert_value_limit<V: Into<uint256> + Copy>(
889 limit: EvmCollectionLimits,
890 value: &Option<V>,
891) -> (EvmCollectionLimits, bool, uint256) {
892 value
893 .map(|v| (limit, true, v.into()))
894 .unwrap_or((limit, false, Default::default()))
895}
896
897fn convert_bool_limit(
898 limit: EvmCollectionLimits,
899 value: &Option<bool>,
900) -> (EvmCollectionLimits, bool, uint256) {
901 value
902 .map(|v| {
903 (
904 limit,
905 true,
906 if v {
907 uint256::from(1)
908 } else {
909 Default::default()
910 },
911 )
912 })
913 .unwrap_or((limit, false, Default::default()))
914}
915888