git.delta.rocks / unique-network / refs/commits / 133c3f17cae5

difftreelog

change function name `tokenProperties` to `properties`

PraetorP2022-11-25parent: #e5a8b87.patch.diff
in: master

12 files changed

modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
721 /// @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>,
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
676}676}
677677
678/// @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 0xb74c26b7
680contract 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 contract
682 /// @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;
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
749 /// @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>,
modifiedpallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
674}674}
675675
676/// @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 0x12f7d6c1
678contract 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 contract
680 /// @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;
modifiedtests/src/eth/abi/nonFungible.jsondiffbeforeafterboth
445 "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" }
modifiedtests/src/eth/abi/reFungible.jsondiffbeforeafterboth
427 "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" }
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
446}446}
447447
448/// @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 0xb74c26b7
450interface 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 contract
452 /// @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);
481481
482 /// @notice Set or reaffirm the approved address for an NFT482 /// @notice Set or reaffirm the approved address for an NFT
483 /// @dev The zero address indicates there is no approved address.483 /// @dev The zero address indicates there is no approved address.
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
444}444}
445445
446/// @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 0x12f7d6c1
448interface 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 contract
450 /// @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);
479479
480 /// @notice Transfer ownership of an RFT480 /// @notice Transfer ownership of an RFT
481 /// @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`
modifiedtests/src/eth/base.test.tsdiffbeforeafterboth
117 });117 });
118118
119 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 });
122122
123 itEth('ERC721Burnable - 0x42966c68 - support', async ({helper}) => {123 itEth('ERC721Burnable - 0x42966c68 - support', async ({helper}) => {
modifiedtests/src/eth/tokenProperties.test.tsdiffbeforeafterboth
120 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([]);
124124
125 await contract.methods.setProperties(token.tokenId, properties).send({from: caller});125 await contract.methods.setProperties(token.tokenId, properties).send({from: caller});
126126
127 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(properties
131 .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