difftreelog
test add+remove a property doesn't change consumed space
in: master
2 files changed
tests/src/nesting/collectionProperties.test.tsdiffbeforeafterboth166 }166 }167 }));167 }));168169 [170 {mode: 'nft' as const, requiredPallets: []},171 {mode: 'rft' as const, requiredPallets: [Pallets.ReFungible]}, 172 ].map(testCase =>173 itSub.ifWithPallets(`Adding then removing a collection property doesn't change the consumed space (${testCase.mode})`, testCase.requiredPallets, async({helper}) => {174 const propKey = 'tok-prop';175176 const collection = await helper[testCase.mode].mintCollection(alice);177 const originalSpace = await collection.getPropertiesConsumedSpace();178179 const propDataSize = 4096;180 const propData = 'a'.repeat(propDataSize);181182 await collection.setProperties(alice, [{key: propKey, value: propData}]);183 let consumedSpace = await collection.getPropertiesConsumedSpace();184 expect(consumedSpace).to.be.equal(propDataSize);185186 await collection.deleteProperties(alice, [propKey]);187 consumedSpace = await collection.getPropertiesConsumedSpace();188 expect(consumedSpace).to.be.equal(originalSpace);189 }));168});190});169 191 170describe('Negative Integration Test: Collection Properties', () => {192describe('Negative Integration Test: Collection Properties', () => {tests/src/nesting/tokenProperties.test.tsdiffbeforeafterboth368 }368 }369 }));369 }));370371 [372 {mode: 'nft' as const, pieces: undefined, requiredPallets: []},373 {mode: 'rft' as const, pieces: 100n, requiredPallets: [Pallets.ReFungible]}, 374 ].map(testCase =>375 itSub.ifWithPallets(`Adding then removing a token property doesn't change the consumed space (${testCase.mode})`, testCase.requiredPallets, async({helper}) => {376 const propKey = 'tok-prop';377378 const collection = await helper[testCase.mode].mintCollection(alice, {379 tokenPropertyPermissions: [380 {381 key: propKey,382 permission: {mutable: true, tokenOwner: true},383 },384 ],385 });386 const token = await (387 testCase.pieces388 ? collection.mintToken(alice, testCase.pieces)389 : collection.mintToken(alice)390 );391 const originalSpace = await token.getTokenPropertiesConsumedSpace();392393 const propDataSize = 4096;394 const propData = 'a'.repeat(propDataSize);395396 await token.setProperties(alice, [{key: propKey, value: propData}]);397 let consumedSpace = await token.getTokenPropertiesConsumedSpace();398 expect(consumedSpace).to.be.equal(propDataSize);399400 await token.deleteProperties(alice, [propKey]);401 consumedSpace = await token.getTokenPropertiesConsumedSpace();402 expect(consumedSpace).to.be.equal(originalSpace);403 }));370});404});371405372describe('Negative Integration Test: Token Properties', () => {406describe('Negative Integration Test: Token Properties', () => {