git.delta.rocks / unique-network / refs/commits / 3a7bee5fca4c

difftreelog

Fix eslint errors

Max Andreev2022-10-19parent: #2e3c4de.patch.diff
in: master

5 files changed

modifiedtests/src/eth/base.test.tsdiffbeforeafterboth

no syntactic changes

modifiedtests/src/eth/collectionProperties.test.tsdiffbeforeafterboth
87 const caller = await helper.eth.createAccountWithBalance(donor);87 const caller = await helper.eth.createAccountWithBalance(donor);
88 const bruh = await helper.eth.createAccountWithBalance(donor);88 const bruh = await helper.eth.createAccountWithBalance(donor);
8989
90 const BASE_URI = 'base/'90 const BASE_URI = 'base/';
91 const SUFFIX = 'suffix1'91 const SUFFIX = 'suffix1';
92 const URI = 'uri1'92 const URI = 'uri1';
9393
94 const collectionHelpers = helper.ethNativeContract.collectionHelpers(caller);94 const collectionHelpers = helper.ethNativeContract.collectionHelpers(caller);
95 const creatorMethod = mode === 'rft' ? 'createRFTCollection' : 'createNFTCollection'95 const creatorMethod = mode === 'rft' ? 'createRFTCollection' : 'createNFTCollection';
9696
97 const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p')97 const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p');
9898
99 const contract = helper.ethNativeContract.collectionById(collectionId, mode, caller);99 const contract = helper.ethNativeContract.collectionById(collectionId, mode, caller);
100 await contract.methods.addCollectionAdmin(bruh).send(); // to check that admin will work too100 await contract.methods.addCollectionAdmin(bruh).send(); // to check that admin will work too
101101
102 const collection1 = await helper.nft.getCollectionObject(collectionId);102 const collection1 = await helper.nft.getCollectionObject(collectionId);
103 const data1 = await collection1.getData()103 const data1 = await collection1.getData();
104 expect(data1?.raw.flags.erc721metadata).to.be.false;104 expect(data1?.raw.flags.erc721metadata).to.be.false;
105 expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false;105 expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false;
106106
110 expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true;110 expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true;
111111
112 const collection2 = await helper.nft.getCollectionObject(collectionId);112 const collection2 = await helper.nft.getCollectionObject(collectionId);
113 const data2 = await collection2.getData()113 const data2 = await collection2.getData();
114 expect(data2?.raw.flags.erc721metadata).to.be.true;114 expect(data2?.raw.flags.erc721metadata).to.be.true;
115115
116 const TPPs = data2?.raw.tokenPropertyPermissions116 const TPPs = data2?.raw.tokenPropertyPermissions;
117 expect(TPPs?.length).to.equal(2);117 expect(TPPs?.length).to.equal(2);
118118
119 expect(TPPs.find((tpp: ITokenPropertyPermission) => {119 expect(TPPs.find((tpp: ITokenPropertyPermission) => {
120 return tpp.key === "URI" && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner120 return tpp.key === 'URI' && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner;
121 })).to.be.not.null121 })).to.be.not.null;
122122
123 expect(TPPs.find((tpp: ITokenPropertyPermission) => {123 expect(TPPs.find((tpp: ITokenPropertyPermission) => {
124 return tpp.key === "URISuffix" && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner124 return tpp.key === 'URISuffix' && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner;
125 })).to.be.not.null125 })).to.be.not.null;
126126
127 expect(data2?.raw.properties?.find((property: IProperty) => {127 expect(data2?.raw.properties?.find((property: IProperty) => {
128 return property.key === "baseURI" && property.value === BASE_URI128 return property.key === 'baseURI' && property.value === BASE_URI;
129 })).to.be.not.null129 })).to.be.not.null;
130130
131 const token1Result = await contract.methods.mint(bruh).send();131 const token1Result = await contract.methods.mint(bruh).send();
132 const tokenId1 = token1Result.events.Transfer.returnValues.tokenId;132 const tokenId1 = token1Result.events.Transfer.returnValues.tokenId;
133133
134 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI);134 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI);
135135
136 await contract.methods.setProperty(tokenId1, "URISuffix", Buffer.from(SUFFIX)).send();136 await contract.methods.setProperty(tokenId1, 'URISuffix', Buffer.from(SUFFIX)).send();
137 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX);137 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX);
138138
139 await contract.methods.setProperty(tokenId1, "URI", Buffer.from(URI)).send();139 await contract.methods.setProperty(tokenId1, 'URI', Buffer.from(URI)).send();
140 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(URI);140 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(URI);
141141
142 await contract.methods.deleteProperty(tokenId1, "URI").send();142 await contract.methods.deleteProperty(tokenId1, 'URI').send();
143 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX);143 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX);
144144
145 const token2Result = await contract.methods.mintWithTokenURI(bruh, URI).send();145 const token2Result = await contract.methods.mintWithTokenURI(bruh, URI).send();
146 const tokenId2 = token2Result.events.Transfer.returnValues.tokenId;146 const tokenId2 = token2Result.events.Transfer.returnValues.tokenId;
147147
148 expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(URI);148 expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(URI);
149149
150 await contract.methods.deleteProperty(tokenId2, "URI").send();150 await contract.methods.deleteProperty(tokenId2, 'URI').send();
151 expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI);151 expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI);
152152
153 await contract.methods.setProperty(tokenId2, "URISuffix", Buffer.from(SUFFIX)).send();153 await contract.methods.setProperty(tokenId2, 'URISuffix', Buffer.from(SUFFIX)).send();
154 expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI + SUFFIX);154 expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI + SUFFIX);
155 }155 };
156156
157 itEth('ERC721Metadata property can be set for NFT collection', async({helper}) => {157 itEth('ERC721Metadata property can be set for NFT collection', async({helper}) => {
158 await checkERC721Metadata(helper, 'nft');158 await checkERC721Metadata(helper, 'nft');
modifiedtests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth
247247
248 const userCollectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', user);248 const userCollectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', user);
249249
250 let result = await userCollectionEvm.methods.mintWithTokenURI(user, 'Test URI',).send();250 const result = await userCollectionEvm.methods.mintWithTokenURI(user, 'Test URI').send();
251 const tokenId = result.events.Transfer.returnValues.tokenId;251 const tokenId = result.events.Transfer.returnValues.tokenId;
252252
253 const events = helper.eth.normalizeEvents(result.events);253 const events = helper.eth.normalizeEvents(result.events);
modifiedtests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth
111 await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send();111 await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send();
112112
113 {113 {
114 const nextTokenId = await contract.methods.nextTokenId().call()114 const nextTokenId = await contract.methods.nextTokenId().call();
115 const result = await contract.methods.mintWithTokenURI(receiver, nextTokenId, 'Test URI').send({from: caller});115 const result = await contract.methods.mintWithTokenURI(receiver, nextTokenId, 'Test URI').send({from: caller});
116 const tokenId = result.events.Transfer.returnValues.tokenId;116 const tokenId = result.events.Transfer.returnValues.tokenId;
117 expect(tokenId).to.be.equal('1');117 expect(tokenId).to.be.equal('1');
modifiedtests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth
189 async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> {189 async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> {
190 const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);190 const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);
191191
192 const {collectionId, collectionAddress} = await this.createNFTCollection(signer, name, description, tokenPrefix)192 const {collectionId, collectionAddress} = await this.createNFTCollection(signer, name, description, tokenPrefix);
193193
194 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();194 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();
195195
211 async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> {211 async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> {
212 const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);212 const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);
213213
214 const {collectionId, collectionAddress} = await this.createRFTCollection(signer, name, description, tokenPrefix)214 const {collectionId, collectionAddress} = await this.createRFTCollection(signer, name, description, tokenPrefix);
215215
216 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();216 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();
217217