git.delta.rocks / unique-network / refs/commits / 6f2de8e52e31

difftreelog

destroyCollectionEvent migrated

rkv2022-09-26parent: #81a7dac.patch.diff
in: master

1 file changed

modifiedtests/src/check-event/destroyCollectionEvent.test.tsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {ApiPromise} from '@polkadot/api';
19import {IKeyringPair} from '@polkadot/types/types';18import {IKeyringPair} from '@polkadot/types/types';
20import chai from 'chai';
21import chaiAsPromised from 'chai-as-promised';
22import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';19import {executeTransaction} from '../substrate/substrate-api';
23import {createCollectionExpectSuccess, uniqueEventMessage} from '../util/helpers';20import {uniqueEventMessage} from '../util/helpers';
24
25chai.use(chaiAsPromised);
26const expect = chai.expect;21import {itSub, usingPlaygrounds, expect} from '../util/playgrounds';
2722
28describe('Destroy collection event ', () => {23describe('Destroy collection event ', () => {
29 let alice: IKeyringPair;24 let alice: IKeyringPair;
30 const checkTreasury = 'Deposit';25 const checkTreasury = 'Deposit';
31 const checkSystem = 'ExtrinsicSuccess';26 const checkSystem = 'ExtrinsicSuccess';
32 before(async () => {27 before(async () => {
33 await usingApi(async (api, privateKeyWrapper) => {28 await usingPlaygrounds(async (helper, privateKey) => {
34 alice = privateKeyWrapper('//Alice');29 const donor = privateKey('//Alice');
30 [alice] = await helper.arrange.createAccounts([10n], donor);
35 });31 });
36 });32 });
33
37 it('Check event from destroyCollection(): ', async () => {34 itSub('Check event from destroyCollection(): ', async ({helper}) => {
38 await usingApi(async (api: ApiPromise) => {35 const {collectionId} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'});
39 const collectionID = await createCollectionExpectSuccess();36 const destroyCollectionTx = helper.api!.tx.unique.destroyCollection(collectionId);
40 const destroyCollection = api.tx.unique.destroyCollection(collectionID);37 const events = await executeTransaction(helper.api!, alice, destroyCollectionTx);
41 const events = await submitTransactionAsync(alice, destroyCollection);
42 const msg = JSON.stringify(uniqueEventMessage(events));38 const msg = JSON.stringify(uniqueEventMessage(events));
43 expect(msg).to.be.contain(checkTreasury);39 expect(msg).to.be.contain(checkTreasury);
44 expect(msg).to.be.contain(checkSystem);40 expect(msg).to.be.contain(checkSystem);
45 });
46 });41 });
47});42});
4843