difftreelog
change function name `tokenProperties` to `properties`
in: master
12 files changed
pallets/nonfungible/src/erc.rsdiffbeforeafterboth721 /// @param tokenId Id for the token.721 /// @param tokenId Id for the token.722 /// @param keys Properties keys. Empty keys for all propertyes.722 /// @param keys Properties keys. Empty keys for all propertyes.723 /// @return Vector of properties key/value pairs.723 /// @return Vector of properties key/value pairs.724 fn token_properties(724 fn properties(&self, token_id: uint256, keys: Vec<string>) -> Result<Vec<PropertyStruct>> {725 &self,726 token_id: uint256,727 keys: Vec<string>,pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth676}676}677677678/// @title Unique extensions for ERC721.678/// @title Unique extensions for ERC721.679/// @dev the ERC-165 identifier for this interface is 0xb8f094a0679/// @dev the ERC-165 identifier for this interface is 0xb74c26b7680contract ERC721UniqueExtensions is Dummy, ERC165 {680contract ERC721UniqueExtensions is Dummy, ERC165 {681 /// @notice A descriptive name for a collection of NFTs in this contract681 /// @notice A descriptive name for a collection of NFTs in this contract682 /// @dev EVM selector for this function is: 0x06fdde03,682 /// @dev EVM selector for this function is: 0x06fdde03,722 /// @param tokenId Id for the token.722 /// @param tokenId Id for the token.723 /// @param keys Properties keys. Empty keys for all propertyes.723 /// @param keys Properties keys. Empty keys for all propertyes.724 /// @return Vector of properties key/value pairs.724 /// @return Vector of properties key/value pairs.725 /// @dev EVM selector for this function is: 0xefc26c69,725 /// @dev EVM selector for this function is: 0xe07ede7e,726 /// or in textual repr: tokenProperties(uint256,string[])726 /// or in textual repr: properties(uint256,string[])727 function tokenProperties(uint256 tokenId, string[] memory keys) public view returns (Property[] memory) {727 function properties(uint256 tokenId, string[] memory keys) public view returns (Property[] memory) {728 require(false, stub_error);728 require(false, stub_error);729 tokenId;729 tokenId;730 keys;730 keys;pallets/refungible/src/erc.rsdiffbeforeafterboth749 /// @param tokenId Id for the token.749 /// @param tokenId Id for the token.750 /// @param keys Properties keys. Empty keys for all propertyes.750 /// @param keys Properties keys. Empty keys for all propertyes.751 /// @return Vector of properties key/value pairs.751 /// @return Vector of properties key/value pairs.752 fn token_properties(752 fn properties(&self, token_id: uint256, keys: Vec<string>) -> Result<Vec<PropertyStruct>> {753 &self,754 token_id: uint256,755 keys: Vec<string>,pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth674}674}675675676/// @title Unique extensions for ERC721.676/// @title Unique extensions for ERC721.677/// @dev the ERC-165 identifier for this interface is 0x1d4b64d6677/// @dev the ERC-165 identifier for this interface is 0x12f7d6c1678contract ERC721UniqueExtensions is Dummy, ERC165 {678contract ERC721UniqueExtensions is Dummy, ERC165 {679 /// @notice A descriptive name for a collection of NFTs in this contract679 /// @notice A descriptive name for a collection of NFTs in this contract680 /// @dev EVM selector for this function is: 0x06fdde03,680 /// @dev EVM selector for this function is: 0x06fdde03,720 /// @param tokenId Id for the token.720 /// @param tokenId Id for the token.721 /// @param keys Properties keys. Empty keys for all propertyes.721 /// @param keys Properties keys. Empty keys for all propertyes.722 /// @return Vector of properties key/value pairs.722 /// @return Vector of properties key/value pairs.723 /// @dev EVM selector for this function is: 0xefc26c69,723 /// @dev EVM selector for this function is: 0xe07ede7e,724 /// or in textual repr: tokenProperties(uint256,string[])724 /// or in textual repr: properties(uint256,string[])725 function tokenProperties(uint256 tokenId, string[] memory keys) public view returns (Property[] memory) {725 function properties(uint256 tokenId, string[] memory keys) public view returns (Property[] memory) {726 require(false, stub_error);726 require(false, stub_error);727 tokenId;727 tokenId;728 keys;728 keys;tests/src/eth/abi/nonFungible.jsondiffbeforeafterboth445 "stateMutability": "view",445 "stateMutability": "view",446 "type": "function"446 "type": "function"447 },447 },448 {449 "inputs": [450 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },451 { "internalType": "string[]", "name": "keys", "type": "string[]" }452 ],453 "name": "properties",454 "outputs": [455 {456 "components": [457 { "internalType": "string", "name": "key", "type": "string" },458 { "internalType": "bytes", "name": "value", "type": "bytes" }459 ],460 "internalType": "struct Property[]",461 "name": "",462 "type": "tuple[]"463 }464 ],465 "stateMutability": "view",466 "type": "function"467 },448 {468 {449 "inputs": [469 "inputs": [450 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },470 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },673 "stateMutability": "view",693 "stateMutability": "view",674 "type": "function"694 "type": "function"675 },695 },676 {677 "inputs": [678 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },679 { "internalType": "string[]", "name": "keys", "type": "string[]" }680 ],681 "name": "tokenProperties",682 "outputs": [683 {684 "components": [685 { "internalType": "string", "name": "key", "type": "string" },686 { "internalType": "bytes", "name": "value", "type": "bytes" }687 ],688 "internalType": "struct Property[]",689 "name": "",690 "type": "tuple[]"691 }692 ],693 "stateMutability": "view",694 "type": "function"695 },696 {696 {697 "inputs": [697 "inputs": [698 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }698 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }tests/src/eth/abi/reFungible.jsondiffbeforeafterboth427 "stateMutability": "view",427 "stateMutability": "view",428 "type": "function"428 "type": "function"429 },429 },430 {431 "inputs": [432 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },433 { "internalType": "string[]", "name": "keys", "type": "string[]" }434 ],435 "name": "properties",436 "outputs": [437 {438 "components": [439 { "internalType": "string", "name": "key", "type": "string" },440 { "internalType": "bytes", "name": "value", "type": "bytes" }441 ],442 "internalType": "struct Property[]",443 "name": "",444 "type": "tuple[]"445 }446 ],447 "stateMutability": "view",448 "type": "function"449 },430 {450 {431 "inputs": [451 "inputs": [432 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },452 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },664 "stateMutability": "view",684 "stateMutability": "view",665 "type": "function"685 "type": "function"666 },686 },667 {668 "inputs": [669 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },670 { "internalType": "string[]", "name": "keys", "type": "string[]" }671 ],672 "name": "tokenProperties",673 "outputs": [674 {675 "components": [676 { "internalType": "string", "name": "key", "type": "string" },677 { "internalType": "bytes", "name": "value", "type": "bytes" }678 ],679 "internalType": "struct Property[]",680 "name": "",681 "type": "tuple[]"682 }683 ],684 "stateMutability": "view",685 "type": "function"686 },687 {687 {688 "inputs": [688 "inputs": [689 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }689 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth446}446}447447448/// @title Unique extensions for ERC721.448/// @title Unique extensions for ERC721.449/// @dev the ERC-165 identifier for this interface is 0xb8f094a0449/// @dev the ERC-165 identifier for this interface is 0xb74c26b7450interface ERC721UniqueExtensions is Dummy, ERC165 {450interface ERC721UniqueExtensions is Dummy, ERC165 {451 /// @notice A descriptive name for a collection of NFTs in this contract451 /// @notice A descriptive name for a collection of NFTs in this contract452 /// @dev EVM selector for this function is: 0x06fdde03,452 /// @dev EVM selector for this function is: 0x06fdde03,475 /// @param tokenId Id for the token.475 /// @param tokenId Id for the token.476 /// @param keys Properties keys. Empty keys for all propertyes.476 /// @param keys Properties keys. Empty keys for all propertyes.477 /// @return Vector of properties key/value pairs.477 /// @return Vector of properties key/value pairs.478 /// @dev EVM selector for this function is: 0xefc26c69,478 /// @dev EVM selector for this function is: 0xe07ede7e,479 /// or in textual repr: tokenProperties(uint256,string[])479 /// or in textual repr: properties(uint256,string[])480 function tokenProperties(uint256 tokenId, string[] memory keys) external view returns (Property[] memory);480 function properties(uint256 tokenId, string[] memory keys) external view returns (Property[] memory);481481482 /// @notice Set or reaffirm the approved address for an NFT482 /// @notice Set or reaffirm the approved address for an NFT483 /// @dev The zero address indicates there is no approved address.483 /// @dev The zero address indicates there is no approved address.tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth444}444}445445446/// @title Unique extensions for ERC721.446/// @title Unique extensions for ERC721.447/// @dev the ERC-165 identifier for this interface is 0x1d4b64d6447/// @dev the ERC-165 identifier for this interface is 0x12f7d6c1448interface ERC721UniqueExtensions is Dummy, ERC165 {448interface ERC721UniqueExtensions is Dummy, ERC165 {449 /// @notice A descriptive name for a collection of NFTs in this contract449 /// @notice A descriptive name for a collection of NFTs in this contract450 /// @dev EVM selector for this function is: 0x06fdde03,450 /// @dev EVM selector for this function is: 0x06fdde03,473 /// @param tokenId Id for the token.473 /// @param tokenId Id for the token.474 /// @param keys Properties keys. Empty keys for all propertyes.474 /// @param keys Properties keys. Empty keys for all propertyes.475 /// @return Vector of properties key/value pairs.475 /// @return Vector of properties key/value pairs.476 /// @dev EVM selector for this function is: 0xefc26c69,476 /// @dev EVM selector for this function is: 0xe07ede7e,477 /// or in textual repr: tokenProperties(uint256,string[])477 /// or in textual repr: properties(uint256,string[])478 function tokenProperties(uint256 tokenId, string[] memory keys) external view returns (Property[] memory);478 function properties(uint256 tokenId, string[] memory keys) external view returns (Property[] memory);479479480 /// @notice Transfer ownership of an RFT480 /// @notice Transfer ownership of an RFT481 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`481 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`tests/src/eth/base.test.tsdiffbeforeafterboth117 });117 });118118119 itEth('ERC721UniqueExtensions support', async ({helper}) => {119 itEth('ERC721UniqueExtensions support', async ({helper}) => {120 await checkInterface(helper, '0xb8f094a0', true, true);120 await checkInterface(helper, '0xb74c26b7', true, true);121 });121 });122122123 itEth('ERC721Burnable - 0x42966c68 - support', async ({helper}) => {123 itEth('ERC721Burnable - 0x42966c68 - support', async ({helper}) => {tests/src/eth/tokenProperties.test.tsdiffbeforeafterboth120 const address = helper.ethAddress.fromCollectionId(collection.collectionId);120 const address = helper.ethAddress.fromCollectionId(collection.collectionId);121 const contract = helper.ethNativeContract.collection(address, mode, caller);121 const contract = helper.ethNativeContract.collection(address, mode, caller);122 122 123 expect(await contract.methods.tokenProperties(token.tokenId, []).call()).to.be.deep.equal([]);123 expect(await contract.methods.properties(token.tokenId, []).call()).to.be.deep.equal([]);124124125 await contract.methods.setProperties(token.tokenId, properties).send({from: caller});125 await contract.methods.setProperties(token.tokenId, properties).send({from: caller});126126127 const values = await token.getProperties(properties.map(p => p.key));127 const values = await token.getProperties(properties.map(p => p.key));128 expect(values).to.be.deep.equal(properties.map(p => { return {key: p.key, value: p.value.toString()}; }));128 expect(values).to.be.deep.equal(properties.map(p => { return {key: p.key, value: p.value.toString()}; }));129 129 130 expect(await contract.methods.tokenProperties(token.tokenId, []).call()).to.be.like(properties130 expect(await contract.methods.properties(token.tokenId, []).call()).to.be.like(properties131 .map(p => { return helper.ethProperty.property(p.key, p.value.toString()); }));131 .map(p => { return helper.ethProperty.property(p.key, p.value.toString()); }));132 132 133 expect(await contract.methods.tokenProperties(token.tokenId, [properties[0].key]).call())133 expect(await contract.methods.properties(token.tokenId, [properties[0].key]).call())134 .to.be.like([helper.ethProperty.property(properties[0].key, properties[0].value.toString())]);134 .to.be.like([helper.ethProperty.property(properties[0].key, properties[0].value.toString())]);135 }135 }136 136