difftreelog
Merge pull request #262 from UniqueNetwork/feature/CORE-259
in: master
Integration test (confirmSponsorship): CORE-239
1 file changed
tests/src/confirmSponsorship.test.tsdiffbeforeafterboth374 await confirmSponsorshipExpectFailure(collectionId, '//Bob');374 await confirmSponsorshipExpectFailure(collectionId, '//Bob');375 });375 });376377 it('(!negative test!) Transfer fees are not paid by the sponsor if the transfer failed', async () => {378 const collectionId = await createCollectionExpectSuccess();379 await setCollectionSponsorExpectSuccess(collectionId, bob.address);380 await confirmSponsorshipExpectSuccess(collectionId, '//Bob');381382 await usingApi(async (api) => {383 // Find unused address384 const ownerZeroBalance = await findUnusedAddress(api);385386 // Find another unused address387 const senderZeroBalance = await findUnusedAddress(api);388389 // Mint token for an unused address390 const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', ownerZeroBalance.address);391392 const sponsorBalanceBeforeTx = (await api.query.system.account(bob.address)).data.free.toBigInt();393394 // Try to transfer this token from an unsponsored unused adress to Alice395 const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(alice.address), collectionId, itemId, 0);396 await expect(submitTransactionExpectFailAsync(senderZeroBalance, zeroToAlice)).to.be.rejected;397398 const sponsorBalanceAfterTx = (await api.query.system.account(bob.address)).data.free.toBigInt();399400 expect(sponsorBalanceAfterTx).to.equal(sponsorBalanceBeforeTx);401 });402 });376});403});377404