difftreelog
Merge pull request #68 from usetech-llc/feature/NFTPAR-234
in: master
Feature/nftpar 234
3 files changed
tests/src/addToWhiteList.test.tsdiffbeforeafterbothno changes
tests/src/toggleContractWhiteList.test.tsdiffbeforeafterboth33 });33 });34 });34 });353536 it.only(`Only whitelisted account can call contract`, async () => {36 it(`Only whitelisted account can call contract`, async () => {37 await usingApi(async api => {37 await usingApi(async api => {38 const bob = privateKey("//Bob");38 const bob = privateKey("//Bob");3939tests/src/util/helpers.tsdiffbeforeafterboth620export async function addToWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number, address: string) {620export async function addToWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number, address: string) {621 await usingApi(async (api) => {621 await usingApi(async (api) => {622623 const whiteListedBefore = (await api.query.nft.whiteList(collectionId, address)).toJSON();622624623 // Run the transaction625 // Run the transaction624 const tx = api.tx.nft.addToWhiteList(collectionId, address);626 const tx = api.tx.nft.addToWhiteList(collectionId, address);625 const events = await submitTransactionAsync(sender, tx);627 const events = await submitTransactionAsync(sender, tx);626 const result = getGenericResult(events);628 const result = getGenericResult(events);627629628 // Get the collection629 const collection: any = (await api.query.nft.collection(collectionId)).toJSON();630 const whiteListedAfter = (await api.query.nft.whiteList(collectionId, address)).toJSON();630631631 // What to expect632 // What to expect632 // tslint:disable-next-line:no-unused-expression633 // tslint:disable-next-line:no-unused-expression633 expect(result.success).to.be.true;634 expect(result.success).to.be.true;635 // tslint:disable-next-line: no-unused-expression636 expect(whiteListedBefore).to.be.false;637 // tslint:disable-next-line: no-unused-expression634 expect(collection.MintMode).to.be.equal(true);638 expect(whiteListedAfter).to.be.true;635 });639 });636}640}637641