difftreelog
refactor method `set_collection_properties` , fix comments
in: master
1 file changed
pallets/common/src/erc.rsdiffbeforeafterboth107 properties: Vec<(string, bytes)>,107 properties: Vec<(string, bytes)>,108 ) -> Result<void> {108 ) -> Result<void> {109 110 let caller = T::CrossAccountId::from_eth(caller);111109 for (key, value) in properties.into_iter() {112 let properties = properties113 .into_iter()114 .map(|(key, value)| {115 let key = <Vec<u8>>::from(key)116 .try_into()110 self.set_collection_property(caller, key, value)?;117 .map_err(|_| "key too large")?;118119 let value = value.0.try_into().map_err(|_| "value too large")?;120121 Ok(Property { key, value })111 }122 })123 .collect::<Result<Vec<_>>>()?;124125 <Pallet<T>>::set_collection_properties(self, &caller, properties)112 Ok(())126 .map_err(dispatch_to_evm::<T>)113 }127 }114128115 /// Delete collection property.129 /// Delete collection property.643657644 /// Get collection owner.658 /// Get collection owner.645 ///659 ///646 /// @return Tuble with sponsor address and his substrate mirror.660 /// @return Tuple with sponsor address and his substrate mirror.647 /// If address is canonical then substrate mirror is zero and vice versa.661 /// If address is canonical then substrate mirror is zero and vice versa.648 fn collection_owner(&self) -> Result<(address, uint256)> {662 fn collection_owner(&self) -> Result<(address, uint256)> {649 Ok(convert_cross_account_to_tuple::<T>(663 Ok(convert_cross_account_to_tuple::<T>(