git.delta.rocks / unique-network / refs/commits / ed290c7b29d8

difftreelog

Merge pull request #41 from usetech-llc/features/NFTPAR-240(path)

Greg Zaitsev2020-12-21parents: #feee462 #cba336c.patch.diff
in: master
Update helpers.ts

1 file changed

modifiedtests/src/util/helpers.tsdiffbeforeafterboth
35export async function createCollectionExpectSuccess(name: string, description: string, tokenPrefix: string, mode: string) {35export async function createCollectionExpectSuccess(name: string, description: string, tokenPrefix: string, mode: string) {
36 await usingApi(async (api) => {36 await usingApi(async (api) => {
37 // Get number of collections before the transaction37 // Get number of collections before the transaction
38 const AcollectionCount = parseInt((await api.query.nft.collectionCount()).toString());38 const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());
3939
40 // Run the CreateCollection transaction40 // Run the CreateCollection transaction
41 const alicePrivateKey = privateKey('//Alice');41 const alicePrivateKey = privateKey('//Alice');
44 const result = getCreateCollectionResult(events);44 const result = getCreateCollectionResult(events);
4545
46 // Get number of collections after the transaction46 // Get number of collections after the transaction
47 const BcollectionCount = parseInt((await api.query.nft.collectionCount()).toString());47 const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());
4848
49 // Get the collection 49 // Get the collection
50 const collection: any = (await api.query.nft.collection(result.collectionId)).toJSON();50 const collection: any = (await api.query.nft.collection(result.collectionId)).toJSON();
64export async function createCollectionExpectFailure(name: string, description: string, tokenPrefix: string, mode: string) {64export async function createCollectionExpectFailure(name: string, description: string, tokenPrefix: string, mode: string) {
65 await usingApi(async (api) => {65 await usingApi(async (api) => {
66 // Get number of collections before the transaction66 // Get number of collections before the transaction
67 const AcollectionCount = parseInt((await api.query.nft.collectionCount()).toString());67 const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());
6868
69 // Run the CreateCollection transaction69 // Run the CreateCollection transaction
70 const alicePrivateKey = privateKey('//Alice');70 const alicePrivateKey = privateKey('//Alice');
73 const result = getCreateCollectionResult(events);73 const result = getCreateCollectionResult(events);
7474
75 // Get number of collections after the transaction75 // Get number of collections after the transaction
76 const BcollectionCount = parseInt((await api.query.nft.collectionCount()).toString());76 const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());
7777
78 // What to expect78 // What to expect
79 expect(result.success).to.be.false;79 expect(result.success).to.be.false;