difftreelog
Fix tests
in: master
3 files changed
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth51 .send();51 .send();52 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);52 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);535354 const newAdmin = privateKey('//Alice');54 const newAdmin = privateKeyWrapper('//Alice');55 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);55 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);56 await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send();56 await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send();5757180 .send();180 .send();181 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);181 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);182182183 const newAdmin = privateKey('//Alice');183 const newAdmin = privateKeyWrapper('//Alice');184 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);184 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);185 await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send();185 await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send();186 {186 {255 .send();255 .send();256 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);256 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);257257258 const adminSub = privateKey('//Alice');258 const adminSub = privateKeyWrapper('//Alice');259 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);259 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);260 await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();260 await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();261 const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);261 const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);280 .send();280 .send();281 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);281 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);282282283 const adminSub = privateKey('//Alice');283 const adminSub = privateKeyWrapper('//Alice');284 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);284 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);285 await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();285 await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();286 const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);286 const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);tests/src/nesting/graphs.test.tsdiffbeforeafterboth13 * ```13 * ```14 */14 */15async function buildComplexObjectGraph(api: ApiPromise, sender: IKeyringPair): Promise<number> {15async function buildComplexObjectGraph(api: ApiPromise, sender: IKeyringPair): Promise<number> {16 const events = await executeTransaction(api, sender, api.tx.unique.createCollectionEx({mode: 'NFT', permissions: {nesting: 'Owner'}}));16 const events = await executeTransaction(api, sender, api.tx.unique.createCollectionEx({mode: 'NFT', permissions: {nesting: {tokenOwner: true}}}));17 const {collectionId} = getCreateCollectionResult(events);17 const {collectionId} = getCreateCollectionResult(events);181819 await executeTransaction(api, sender, api.tx.unique.createMultipleItemsEx(collectionId, {NFT: Array(8).fill({owner: {Substrate: sender.address}})}));19 await executeTransaction(api, sender, api.tx.unique.createMultipleItemsEx(collectionId, {NFT: Array(8).fill({owner: {Substrate: sender.address}})}));tests/src/nesting/rules-smoke.test.tsdiffbeforeafterboth27 await usingApi(async api => {27 await usingApi(async api => {28 const collection = await createCollectionExpectSuccess({mode: {type: 'Fungible',decimalPoints:0}});28 const collection = await createCollectionExpectSuccess({mode: {type: 'Fungible',decimalPoints:0}});29 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {Fungible: {Value: 1}})))29 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {Fungible: {Value: 1}})))30 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);30 .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);313132 await createFungibleItemExpectSuccess(alice, collection, {Value:1n}, {Substrate: alice.address});32 await createFungibleItemExpectSuccess(alice, collection, {Value:1n}, {Substrate: alice.address});33 await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, 0, 1n)))33 await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, 0, 1n)))34 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);34 .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);35 });35 });36 });36 });373738 it('called for nonfungible', async () => {38 it('called for nonfungible', async () => {39 await usingApi(async api => {39 await usingApi(async api => {40 const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});40 const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});41 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {NFT: {properties: []}})))41 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {NFT: {properties: []}})))42 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);42 .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);434344 const token = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});44 const token = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});45 await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, token, 1n)))45 await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, token, 1n)))46 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);46 .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);47 });47 });48 });48 });494950 it('called for refungible', async () => {50 it('called for refungible', async () => {51 await usingApi(async api => {51 await usingApi(async api => {52 const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});52 const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});53 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {ReFungible: {}})))53 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {ReFungible: {}})))54 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);54 .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);555556 const token = await createItemExpectSuccess(alice, collection, 'ReFungible', {Substrate: alice.address});56 const token = await createItemExpectSuccess(alice, collection, 'ReFungible', {Substrate: alice.address});57 await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, token, 1n)))57 await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, token, 1n)))58 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);58 .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);59 });59 });60 });60 });61});61});