git.delta.rocks / unique-network / refs/commits / 8a8e3dd6965d

difftreelog

Merge pull request #68 from usetech-llc/feature/NFTPAR-234

Greg Zaitsev2021-01-19parents: #2390e16 #a246f26.patch.diff
in: master
Feature/nftpar 234

3 files changed

addedtests/src/addToWhiteList.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/toggleContractWhiteList.test.tsdiffbeforeafterboth
33 });33 });
34 });34 });
3535
36 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");
3939
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
620export 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) => {
622
623 const whiteListedBefore = (await api.query.nft.whiteList(collectionId, address)).toJSON();
622624
623 // Run the transaction625 // Run the transaction
624 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);
627629
628 // Get the collection
629 const collection: any = (await api.query.nft.collection(collectionId)).toJSON();630 const whiteListedAfter = (await api.query.nft.whiteList(collectionId, address)).toJSON();
630631
631 // What to expect632 // What to expect
632 // tslint:disable-next-line:no-unused-expression633 // tslint:disable-next-line:no-unused-expression
633 expect(result.success).to.be.true;634 expect(result.success).to.be.true;
635 // tslint:disable-next-line: no-unused-expression
636 expect(whiteListedBefore).to.be.false;
637 // tslint:disable-next-line: no-unused-expression
634 expect(collection.MintMode).to.be.equal(true);638 expect(whiteListedAfter).to.be.true;
635 });639 });
636}640}
637641