git.delta.rocks / unique-network / refs/commits / 73706f6e09f5

difftreelog

test normalize account id in burnFrom tests

Yaroslav Bolyukin2021-10-20parent: #c7f2aa6.patch.diff
in: master

1 file changed

modifiedtests/src/burnItem.test.tsdiffbeforeafterboth
166 });166 });
167167
168168
169 it.only('Burn item in Fungible collection', async () => {169 it('Burn item in Fungible collection', async () => {
170 const createMode = 'Fungible';170 const createMode = 'Fungible';
171 const collectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0 }});171 const collectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0 }});
172 const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); // Helper creates 10 fungible tokens172 const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); // Helper creates 10 fungible tokens
173 await addCollectionAdminExpectSuccess(alice, collectionId, bob);173 await addCollectionAdminExpectSuccess(alice, collectionId, bob);
174174
175 await usingApi(async (api) => {175 await usingApi(async (api) => {
176 // Destroy 1 of 10176 // Destroy 1 of 10
177 const tx = api.tx.nft.burnFrom(collectionId, alice.address, tokenId, 1);177 const tx = api.tx.nft.burnFrom(collectionId, normalizeAccountId(alice.address), tokenId, 1);
178 const events = await submitTransactionAsync(bob, tx);178 const events = await submitTransactionAsync(bob, tx);
179 const result = getGenericResult(events);179 const result = getGenericResult(events);
180180
188 });188 });
189 });189 });
190190
191 it.only('Burn item in ReFungible collection', async () => {191 it('Burn item in ReFungible collection', async () => {
192 const createMode = 'ReFungible';192 const createMode = 'ReFungible';
193 const collectionId = await createCollectionExpectSuccess({mode: {type: createMode }});193 const collectionId = await createCollectionExpectSuccess({mode: {type: createMode }});
194 const tokenId = await createItemExpectSuccess(alice, collectionId, createMode);194 const tokenId = await createItemExpectSuccess(alice, collectionId, createMode);
195 await addCollectionAdminExpectSuccess(alice, collectionId, bob);195 await addCollectionAdminExpectSuccess(alice, collectionId, bob);
196196
197 await usingApi(async (api) => {197 await usingApi(async (api) => {
198 const tx = api.tx.nft.burnFrom(collectionId, alice.address, tokenId, 100);198 const tx = api.tx.nft.burnFrom(collectionId, normalizeAccountId(alice.address), tokenId, 100);
199 const events = await submitTransactionAsync(bob, tx);199 const events = await submitTransactionAsync(bob, tx);
200 const result = getGenericResult(events);200 const result = getGenericResult(events);
201 // Get alice balance201 // Get alice balance