--- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -106,10 +106,24 @@ caller: caller, properties: Vec<(string, bytes)>, ) -> Result { - for (key, value) in properties.into_iter() { - self.set_collection_property(caller, key, value)?; - } - Ok(()) + + let caller = T::CrossAccountId::from_eth(caller); + + let properties = properties + .into_iter() + .map(|(key, value)| { + let key = >::from(key) + .try_into() + .map_err(|_| "key too large")?; + + let value = value.0.try_into().map_err(|_| "value too large")?; + + Ok(Property { key, value }) + }) + .collect::>>()?; + + >::set_collection_properties(self, &caller, properties) + .map_err(dispatch_to_evm::) } /// Delete collection property. @@ -643,7 +657,7 @@ /// Get collection owner. /// - /// @return Tuble with sponsor address and his substrate mirror. + /// @return Tuple with sponsor address and his substrate mirror. /// If address is canonical then substrate mirror is zero and vice versa. fn collection_owner(&self) -> Result<(address, uint256)> { Ok(convert_cross_account_to_tuple::(