difftreelog
feat change `collection_properties` return type to named struct
in: master
16 files changed
pallets/common/src/erc.rsdiffbeforeafterboth178 ///178 ///179 /// @param keys Properties keys. Empty keys for all propertyes.179 /// @param keys Properties keys. Empty keys for all propertyes.180 /// @return Vector of properties key/value pairs.180 /// @return Vector of properties key/value pairs.181 fn collection_properties(&self, keys: Vec<string>) -> Result<Vec<(string, bytes)>> {181 fn collection_properties(&self, keys: Vec<string>) -> Result<Vec<PropertyStruct>> {182 let keys = keys182 let keys = keys183 .into_iter()183 .into_iter()184 .map(|key| {184 .map(|key| {200 let key =200 let key =201 string::from_utf8(p.key.into()).map_err(|e| Error::Revert(format!("{}", e)))?;201 string::from_utf8(p.key.into()).map_err(|e| Error::Revert(format!("{}", e)))?;202 let value = bytes(p.value.to_vec());202 let value = bytes(p.value.to_vec());203 Ok((key, value))203 Ok(PropertyStruct { key, value })204 })204 })205 .collect::<Result<Vec<_>>>()?;205 .collect::<Result<Vec<_>>>()?;206 Ok(properties)206 Ok(properties)pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth87 /// @return Vector of properties key/value pairs.87 /// @return Vector of properties key/value pairs.88 /// @dev EVM selector for this function is: 0x285fb8e6,88 /// @dev EVM selector for this function is: 0x285fb8e6,89 /// or in textual repr: collectionProperties(string[])89 /// or in textual repr: collectionProperties(string[])90 function collectionProperties(string[] memory keys) public view returns (Tuple16[] memory) {90 function collectionProperties(string[] memory keys) public view returns (Property[] memory) {91 require(false, stub_error);91 require(false, stub_error);92 keys;92 keys;93 dummy;93 dummy;94 return new Tuple16[](0);94 return new Property[](0);95 }95 }969697 // /// Set the sponsor of the collection.97 // /// Set the sponsor of the collection.425 uint256 sub;425 uint256 sub;426}426}427428/// @dev anonymous struct429struct Tuple16 {430 string field_0;431 bytes field_1;432}433427434/// @dev Property struct428/// @dev Property struct435struct Property {429struct Property {pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth188 /// @return Vector of properties key/value pairs.188 /// @return Vector of properties key/value pairs.189 /// @dev EVM selector for this function is: 0x285fb8e6,189 /// @dev EVM selector for this function is: 0x285fb8e6,190 /// or in textual repr: collectionProperties(string[])190 /// or in textual repr: collectionProperties(string[])191 function collectionProperties(string[] memory keys) public view returns (Tuple27[] memory) {191 function collectionProperties(string[] memory keys) public view returns (Property[] memory) {192 require(false, stub_error);192 require(false, stub_error);193 keys;193 keys;194 dummy;194 dummy;195 return new Tuple27[](0);195 return new Property[](0);196 }196 }197197198 // /// Set the sponsor of the collection.198 // /// Set the sponsor of the collection.532 uint256 field_1;532 uint256 field_1;533}533}534535/// @dev anonymous struct536struct Tuple27 {537 string field_0;538 bytes field_1;539}540534541/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension535/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension542/// @dev See https://eips.ethereum.org/EIPS/eip-721536/// @dev See https://eips.ethereum.org/EIPS/eip-721pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth188 /// @return Vector of properties key/value pairs.188 /// @return Vector of properties key/value pairs.189 /// @dev EVM selector for this function is: 0x285fb8e6,189 /// @dev EVM selector for this function is: 0x285fb8e6,190 /// or in textual repr: collectionProperties(string[])190 /// or in textual repr: collectionProperties(string[])191 function collectionProperties(string[] memory keys) public view returns (Tuple26[] memory) {191 function collectionProperties(string[] memory keys) public view returns (Property[] memory) {192 require(false, stub_error);192 require(false, stub_error);193 keys;193 keys;194 dummy;194 dummy;195 return new Tuple26[](0);195 return new Property[](0);196 }196 }197197198 // /// Set the sponsor of the collection.198 // /// Set the sponsor of the collection.532 uint256 field_1;532 uint256 field_1;533}533}534535/// @dev anonymous struct536struct Tuple26 {537 string field_0;538 bytes field_1;539}540534541/// @dev the ERC-165 identifier for this interface is 0x5b5e139f535/// @dev the ERC-165 identifier for this interface is 0x5b5e139f542contract ERC721Metadata is Dummy, ERC165 {536contract ERC721Metadata is Dummy, ERC165 {pallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterbothbinary blob — no preview
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
tests/src/eth/abi/fungible.jsondiffbeforeafterboth216 "outputs": [216 "outputs": [217 {217 {218 "components": [218 "components": [219 { "internalType": "string", "name": "field_0", "type": "string" },219 { "internalType": "string", "name": "key", "type": "string" },220 { "internalType": "bytes", "name": "field_1", "type": "bytes" }220 { "internalType": "bytes", "name": "value", "type": "bytes" }221 ],221 ],222 "internalType": "struct Tuple16[]",222 "internalType": "struct Property[]",223 "name": "",223 "name": "",224 "type": "tuple[]"224 "type": "tuple[]"225 }225 }tests/src/eth/abi/nonFungible.jsondiffbeforeafterboth246 "outputs": [246 "outputs": [247 {247 {248 "components": [248 "components": [249 { "internalType": "string", "name": "field_0", "type": "string" },249 { "internalType": "string", "name": "key", "type": "string" },250 { "internalType": "bytes", "name": "field_1", "type": "bytes" }250 { "internalType": "bytes", "name": "value", "type": "bytes" }251 ],251 ],252 "internalType": "struct Tuple27[]",252 "internalType": "struct Property[]",253 "name": "",253 "name": "",254 "type": "tuple[]"254 "type": "tuple[]"255 }255 }tests/src/eth/abi/reFungible.jsondiffbeforeafterboth228 "outputs": [228 "outputs": [229 {229 {230 "components": [230 "components": [231 { "internalType": "string", "name": "field_0", "type": "string" },231 { "internalType": "string", "name": "key", "type": "string" },232 { "internalType": "bytes", "name": "field_1", "type": "bytes" }232 { "internalType": "bytes", "name": "value", "type": "bytes" }233 ],233 ],234 "internalType": "struct Tuple26[]",234 "internalType": "struct Property[]",235 "name": "",235 "name": "",236 "type": "tuple[]"236 "type": "tuple[]"237 }237 }tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth60 /// @return Vector of properties key/value pairs.60 /// @return Vector of properties key/value pairs.61 /// @dev EVM selector for this function is: 0x285fb8e6,61 /// @dev EVM selector for this function is: 0x285fb8e6,62 /// or in textual repr: collectionProperties(string[])62 /// or in textual repr: collectionProperties(string[])63 function collectionProperties(string[] memory keys) external view returns (Tuple16[] memory);63 function collectionProperties(string[] memory keys) external view returns (Property[] memory);646465 // /// Set the sponsor of the collection.65 // /// Set the sponsor of the collection.66 // ///66 // ///278 uint256 sub;278 uint256 sub;279}279}280281/// @dev anonymous struct282struct Tuple16 {283 string field_0;284 bytes field_1;285}286280287/// @dev Property struct281/// @dev Property struct288struct Property {282struct Property {tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth127 /// @return Vector of properties key/value pairs.127 /// @return Vector of properties key/value pairs.128 /// @dev EVM selector for this function is: 0x285fb8e6,128 /// @dev EVM selector for this function is: 0x285fb8e6,129 /// or in textual repr: collectionProperties(string[])129 /// or in textual repr: collectionProperties(string[])130 function collectionProperties(string[] memory keys) external view returns (Tuple25[] memory);130 function collectionProperties(string[] memory keys) external view returns (Property[] memory);131131132 // /// Set the sponsor of the collection.132 // /// Set the sponsor of the collection.133 // ///133 // ///169 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.169 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.170 /// @dev EVM selector for this function is: 0x6ec0a9f1,170 /// @dev EVM selector for this function is: 0x6ec0a9f1,171 /// or in textual repr: collectionSponsor()171 /// or in textual repr: collectionSponsor()172 function collectionSponsor() external view returns (Tuple28 memory);172 function collectionSponsor() external view returns (Tuple27 memory);173173174 /// Set limits for the collection.174 /// Set limits for the collection.175 /// @dev Throws error if limit not found.175 /// @dev Throws error if limit not found.346}346}347347348/// @dev anonymous struct348/// @dev anonymous struct349struct Tuple28 {349struct Tuple27 {350 address field_0;350 address field_0;351 uint256 field_1;351 uint256 field_1;352}352}353354/// @dev anonymous struct355struct Tuple25 {356 string field_0;357 bytes field_1;358}359353360/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension354/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension361/// @dev See https://eips.ethereum.org/EIPS/eip-721355/// @dev See https://eips.ethereum.org/EIPS/eip-721tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth127 /// @return Vector of properties key/value pairs.127 /// @return Vector of properties key/value pairs.128 /// @dev EVM selector for this function is: 0x285fb8e6,128 /// @dev EVM selector for this function is: 0x285fb8e6,129 /// or in textual repr: collectionProperties(string[])129 /// or in textual repr: collectionProperties(string[])130 function collectionProperties(string[] memory keys) external view returns (Tuple24[] memory);130 function collectionProperties(string[] memory keys) external view returns (Property[] memory);131131132 // /// Set the sponsor of the collection.132 // /// Set the sponsor of the collection.133 // ///133 // ///169 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.169 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.170 /// @dev EVM selector for this function is: 0x6ec0a9f1,170 /// @dev EVM selector for this function is: 0x6ec0a9f1,171 /// or in textual repr: collectionSponsor()171 /// or in textual repr: collectionSponsor()172 function collectionSponsor() external view returns (Tuple27 memory);172 function collectionSponsor() external view returns (Tuple26 memory);173173174 /// Set limits for the collection.174 /// Set limits for the collection.175 /// @dev Throws error if limit not found.175 /// @dev Throws error if limit not found.346}346}347347348/// @dev anonymous struct348/// @dev anonymous struct349struct Tuple27 {349struct Tuple26 {350 address field_0;350 address field_0;351 uint256 field_1;351 uint256 field_1;352}352}353354/// @dev anonymous struct355struct Tuple24 {356 string field_0;357 bytes field_1;358}359353360/// @dev the ERC-165 identifier for this interface is 0x5b5e139f354/// @dev the ERC-165 identifier for this interface is 0x5b5e139f361interface ERC721Metadata is Dummy, ERC165 {355interface ERC721Metadata is Dummy, ERC165 {