--- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -178,7 +178,7 @@ /// /// @param keys Properties keys. Empty keys for all propertyes. /// @return Vector of properties key/value pairs. - fn collection_properties(&self, keys: Vec) -> Result> { + fn collection_properties(&self, keys: Vec) -> Result> { let keys = keys .into_iter() .map(|key| { @@ -200,7 +200,7 @@ let key = string::from_utf8(p.key.into()).map_err(|e| Error::Revert(format!("{}", e)))?; let value = bytes(p.value.to_vec()); - Ok((key, value)) + Ok(PropertyStruct { key, value }) }) .collect::>>()?; Ok(properties) --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -87,11 +87,11 @@ /// @return Vector of properties key/value pairs. /// @dev EVM selector for this function is: 0x285fb8e6, /// or in textual repr: collectionProperties(string[]) - function collectionProperties(string[] memory keys) public view returns (Tuple16[] memory) { + function collectionProperties(string[] memory keys) public view returns (Property[] memory) { require(false, stub_error); keys; dummy; - return new Tuple16[](0); + return new Property[](0); } // /// Set the sponsor of the collection. @@ -423,12 +423,6 @@ struct EthCrossAccount { address eth; uint256 sub; -} - -/// @dev anonymous struct -struct Tuple16 { - string field_0; - bytes field_1; } /// @dev Property struct --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -188,11 +188,11 @@ /// @return Vector of properties key/value pairs. /// @dev EVM selector for this function is: 0x285fb8e6, /// or in textual repr: collectionProperties(string[]) - function collectionProperties(string[] memory keys) public view returns (Tuple27[] memory) { + function collectionProperties(string[] memory keys) public view returns (Property[] memory) { require(false, stub_error); keys; dummy; - return new Tuple27[](0); + return new Property[](0); } // /// Set the sponsor of the collection. @@ -530,12 +530,6 @@ struct Tuple30 { address field_0; uint256 field_1; -} - -/// @dev anonymous struct -struct Tuple27 { - string field_0; - bytes field_1; } /// @title ERC-721 Non-Fungible Token Standard, optional metadata extension --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -188,11 +188,11 @@ /// @return Vector of properties key/value pairs. /// @dev EVM selector for this function is: 0x285fb8e6, /// or in textual repr: collectionProperties(string[]) - function collectionProperties(string[] memory keys) public view returns (Tuple26[] memory) { + function collectionProperties(string[] memory keys) public view returns (Property[] memory) { require(false, stub_error); keys; dummy; - return new Tuple26[](0); + return new Property[](0); } // /// Set the sponsor of the collection. @@ -530,12 +530,6 @@ struct Tuple29 { address field_0; uint256 field_1; -} - -/// @dev anonymous struct -struct Tuple26 { - string field_0; - bytes field_1; } /// @dev the ERC-165 identifier for this interface is 0x5b5e139f --- a/tests/src/eth/abi/fungible.json +++ b/tests/src/eth/abi/fungible.json @@ -216,10 +216,10 @@ "outputs": [ { "components": [ - { "internalType": "string", "name": "field_0", "type": "string" }, - { "internalType": "bytes", "name": "field_1", "type": "bytes" } + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bytes", "name": "value", "type": "bytes" } ], - "internalType": "struct Tuple16[]", + "internalType": "struct Property[]", "name": "", "type": "tuple[]" } --- a/tests/src/eth/abi/nonFungible.json +++ b/tests/src/eth/abi/nonFungible.json @@ -246,10 +246,10 @@ "outputs": [ { "components": [ - { "internalType": "string", "name": "field_0", "type": "string" }, - { "internalType": "bytes", "name": "field_1", "type": "bytes" } + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bytes", "name": "value", "type": "bytes" } ], - "internalType": "struct Tuple27[]", + "internalType": "struct Property[]", "name": "", "type": "tuple[]" } --- a/tests/src/eth/abi/reFungible.json +++ b/tests/src/eth/abi/reFungible.json @@ -228,10 +228,10 @@ "outputs": [ { "components": [ - { "internalType": "string", "name": "field_0", "type": "string" }, - { "internalType": "bytes", "name": "field_1", "type": "bytes" } + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bytes", "name": "value", "type": "bytes" } ], - "internalType": "struct Tuple26[]", + "internalType": "struct Property[]", "name": "", "type": "tuple[]" } --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -60,7 +60,7 @@ /// @return Vector of properties key/value pairs. /// @dev EVM selector for this function is: 0x285fb8e6, /// or in textual repr: collectionProperties(string[]) - function collectionProperties(string[] memory keys) external view returns (Tuple16[] memory); + function collectionProperties(string[] memory keys) external view returns (Property[] memory); // /// Set the sponsor of the collection. // /// @@ -276,12 +276,6 @@ struct EthCrossAccount { address eth; uint256 sub; -} - -/// @dev anonymous struct -struct Tuple16 { - string field_0; - bytes field_1; } /// @dev Property struct --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -127,7 +127,7 @@ /// @return Vector of properties key/value pairs. /// @dev EVM selector for this function is: 0x285fb8e6, /// or in textual repr: collectionProperties(string[]) - function collectionProperties(string[] memory keys) external view returns (Tuple25[] memory); + function collectionProperties(string[] memory keys) external view returns (Property[] memory); // /// Set the sponsor of the collection. // /// @@ -169,7 +169,7 @@ /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x6ec0a9f1, /// or in textual repr: collectionSponsor() - function collectionSponsor() external view returns (Tuple28 memory); + function collectionSponsor() external view returns (Tuple27 memory); /// Set limits for the collection. /// @dev Throws error if limit not found. @@ -346,15 +346,9 @@ } /// @dev anonymous struct -struct Tuple28 { +struct Tuple27 { address field_0; uint256 field_1; -} - -/// @dev anonymous struct -struct Tuple25 { - string field_0; - bytes field_1; } /// @title ERC-721 Non-Fungible Token Standard, optional metadata extension --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -127,7 +127,7 @@ /// @return Vector of properties key/value pairs. /// @dev EVM selector for this function is: 0x285fb8e6, /// or in textual repr: collectionProperties(string[]) - function collectionProperties(string[] memory keys) external view returns (Tuple24[] memory); + function collectionProperties(string[] memory keys) external view returns (Property[] memory); // /// Set the sponsor of the collection. // /// @@ -169,7 +169,7 @@ /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x6ec0a9f1, /// or in textual repr: collectionSponsor() - function collectionSponsor() external view returns (Tuple27 memory); + function collectionSponsor() external view returns (Tuple26 memory); /// Set limits for the collection. /// @dev Throws error if limit not found. @@ -346,15 +346,9 @@ } /// @dev anonymous struct -struct Tuple27 { +struct Tuple26 { address field_0; uint256 field_1; -} - -/// @dev anonymous struct -struct Tuple24 { - string field_0; - bytes field_1; } /// @dev the ERC-165 identifier for this interface is 0x5b5e139f