difftreelog
feat change `collection_properties` return type to named struct
in: master
16 files changed
pallets/common/src/erc.rsdiffbeforeafterboth--- 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<string>) -> Result<Vec<(string, bytes)>> {
+ fn collection_properties(&self, keys: Vec<string>) -> Result<Vec<PropertyStruct>> {
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::<Result<Vec<_>>>()?;
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.soldiffbeforeafterboth--- 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
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- 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
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- 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
pallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterbothbinary blob — no preview
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
tests/src/eth/abi/fungible.jsondiffbeforeafterboth--- 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[]"
}
tests/src/eth/abi/nonFungible.jsondiffbeforeafterboth--- 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[]"
}
tests/src/eth/abi/reFungible.jsondiffbeforeafterboth--- 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[]"
}
tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth--- 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
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- 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
tests/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 {