difftreelog
Fix eslint errors
in: master
5 files changed
tests/src/eth/base.test.tsdiffbeforeafterbothno syntactic changes
tests/src/eth/collectionProperties.test.tsdiffbeforeafterboth87 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);898990 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';939394 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';969697 const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p')97 const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p');989899 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 too101101102 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;106106110 expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true;110 expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true;111111112 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;115115116 const TPPs = data2?.raw.tokenPropertyPermissions116 const TPPs = data2?.raw.tokenPropertyPermissions;117 expect(TPPs?.length).to.equal(2);117 expect(TPPs?.length).to.equal(2);118118119 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;122122123 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;126126127 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;130130131 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;133133134 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI);134 expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI);135135136 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);138138139 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);141141142 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);144144145 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;147147148 expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(URI);148 expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(URI);149149150 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);152152153 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 };156156157 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');tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth247247248 const userCollectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', user);248 const userCollectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', user);249249250 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;252252253 const events = helper.eth.normalizeEvents(result.events);253 const events = helper.eth.normalizeEvents(result.events);tests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth111 await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send();111 await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send();112112113 {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');tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth189 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);191191192 const {collectionId, collectionAddress} = await this.createNFTCollection(signer, name, description, tokenPrefix)192 const {collectionId, collectionAddress} = await this.createNFTCollection(signer, name, description, tokenPrefix);193193194 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();194 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();195195211 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);213213214 const {collectionId, collectionAddress} = await this.createRFTCollection(signer, name, description, tokenPrefix)214 const {collectionId, collectionAddress} = await this.createRFTCollection(signer, name, description, tokenPrefix);215215216 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();216 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();217217