difftreelog
tests(repair): displace sudo tests into seqtests
in: master
5 files changed
tests/package.jsondiffbeforeafterboth44 "testEvmCoder": "mocha --timeout 9999999 -r ts-node/register './**/eth/evmCoder.test.ts'",44 "testEvmCoder": "mocha --timeout 9999999 -r ts-node/register './**/eth/evmCoder.test.ts'",45 "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts",45 "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts",46 "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts",46 "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts",47 "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/collectionProperties.test.ts ./**/tokenProperties.test.ts ./**/getPropertiesRpc.test.ts",47 "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/collectionProperties.*test.ts ./**/tokenProperties.*test.ts ./**/getPropertiesRpc.test.ts",48 "testCollectionProperties": "mocha --timeout 9999999 -r ts-node/register ./**/collectionProperties.test.ts",48 "testCollectionProperties": "mocha --timeout 9999999 -r ts-node/register ./**/collectionProperties.*test.ts",49 "testTokenProperties": "mocha --timeout 9999999 -r ts-node/register ./**/tokenProperties.test.ts",49 "testTokenProperties": "mocha --timeout 9999999 -r ts-node/register ./**/tokenProperties.*test.ts",50 "testMigration": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",50 "testMigration": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",51 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",51 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",52 "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts",52 "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts",tests/src/nesting/collectionProperties.seqtest.tsdiffbeforeafterbothno changes
tests/src/nesting/collectionProperties.test.tsdiffbeforeafterboth18import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip} from '../util';18import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip} from '../util';191920describe('Integration Test: Collection Properties', () => {20describe('Integration Test: Collection Properties', () => {21 let superuser: IKeyringPair;22 let alice: IKeyringPair;21 let alice: IKeyringPair;23 let bob: IKeyringPair;22 let bob: IKeyringPair;24 23 25 before(async () => {24 before(async () => {26 await usingPlaygrounds(async (helper, privateKey) => {25 await usingPlaygrounds(async (helper, privateKey) => {27 superuser = await privateKey('//Alice');28 const donor = await privateKey({filename: __filename});26 const donor = await privateKey({filename: __filename});29 [alice, bob] = await helper.arrange.createAccounts([200n, 10n], donor);27 [alice, bob] = await helper.arrange.createAccounts([200n, 10n], donor);30 });28 });202 expect(consumedSpace).to.be.equal(biggerPropDataSize - expectedConsumedSpaceDiff);200 expect(consumedSpace).to.be.equal(biggerPropDataSize - expectedConsumedSpaceDiff);203 });201 });204205 itSub('Modifying a collection property with different sizes correctly changes the consumed space', async({helper}) => {206 const properties = [207 {key: 'sea-creatures', value: 'mermaids'},208 {key: 'goldenratio', value: '1.6180339887498948482045868343656381177203091798057628621354486227052604628189'},209 ];210 const collection = await helper[testSuite.mode].mintCollection(alice, {properties});211212 const newProperty = ' '.repeat(4096);213 await collection.setProperties(alice, [{key: 'space', value: newProperty}]);214 const originalSpace = await collection.getPropertiesConsumedSpace();215 expect(originalSpace).to.be.equal(properties[0].value.length + properties[1].value.length + newProperty.length);216217 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.unique.forceRepairCollection', [collection.collectionId], true);218 const recomputedSpace = await collection.getPropertiesConsumedSpace();219 expect(recomputedSpace).to.be.equal(originalSpace);220 });221 }));202 }));222});203});223 204 tests/src/nesting/tokenProperties.seqtest.tsdiffbeforeafterbothno changes
tests/src/nesting/tokenProperties.test.tsdiffbeforeafterboth19import {UniqueHelper, UniqueNFToken, UniqueRFToken} from '../util/playgrounds/unique';19import {UniqueHelper, UniqueNFToken, UniqueRFToken} from '../util/playgrounds/unique';202021describe('Integration Test: Token Properties', () => {21describe('Integration Test: Token Properties', () => {22 let superuser: IKeyringPair;23 let alice: IKeyringPair; // collection owner22 let alice: IKeyringPair; // collection owner24 let bob: IKeyringPair; // collection admin23 let bob: IKeyringPair; // collection admin25 let charlie: IKeyringPair; // token owner24 let charlie: IKeyringPair; // token owner282729 before(async () => {28 before(async () => {30 await usingPlaygrounds(async (helper, privateKey) => {29 await usingPlaygrounds(async (helper, privateKey) => {31 superuser = await privateKey('//Alice');32 const donor = await privateKey({filename: __filename});30 const donor = await privateKey({filename: __filename});33 [alice, bob, charlie] = await helper.arrange.createAccounts([200n, 100n, 100n], donor);31 [alice, bob, charlie] = await helper.arrange.createAccounts([200n, 100n, 100n], donor);34 });32 });404 expect(consumedSpace).to.be.equal(originalSpace);402 expect(consumedSpace).to.be.equal(originalSpace);405 }));403 }));406407 [408 {mode: 'nft' as const, pieces: undefined, requiredPallets: []},409 {mode: 'rft' as const, pieces: 100n, requiredPallets: [Pallets.ReFungible]}, 410 ].map(testCase =>411 itSub.ifWithPallets(`force_repair_item preserves valid consumed space (${testCase.mode})`, testCase.requiredPallets, async({helper}) => {412 const propKey = 'tok-prop';413414 const collection = await helper[testCase.mode].mintCollection(alice, {415 tokenPropertyPermissions: [416 {417 key: propKey,418 permission: {mutable: true, tokenOwner: true},419 },420 ],421 });422 const token = await (423 testCase.pieces424 ? collection.mintToken(alice, testCase.pieces)425 : collection.mintToken(alice)426 );427428 const propDataSize = 4096;429 const propData = 'a'.repeat(propDataSize);430431 await token.setProperties(alice, [{key: propKey, value: propData}]);432 const originalSpace = await token.getTokenPropertiesConsumedSpace();433 expect(originalSpace).to.be.equal(propDataSize);434435 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.unique.forceRepairItem', [token.collectionId, token.tokenId], true);436 const recomputedSpace = await token.getTokenPropertiesConsumedSpace();437 expect(recomputedSpace).to.be.equal(originalSpace);438 }));439404440 [405 [441 {mode: 'nft' as const, pieces: undefined, requiredPallets: []},406 {mode: 'nft' as const, pieces: undefined, requiredPallets: []},