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

difftreelog

tests: removeFromWhiteList helpers

Yaroslav Bolyukin2021-01-27parent: #cd2a8fc.patch.diff
in: master

1 file changed

modifiedtests/src/util/helpers.tsdiffbeforeafterboth
681 });681 });
682}682}
683
684export async function removeFromWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number, address: string) {
685 await usingApi(async (api) => {
686 // Run the transaction
687 const tx = api.tx.nft.removeFromWhiteList(collectionId, address);
688 const events = await submitTransactionAsync(sender, tx);
689 const result = getGenericResult(events);
690
691 // What to expect
692 // tslint:disable-next-line:no-unused-expression
693 expect(result.success).to.be.true;
694 });
695}
696
697export async function removeFromWhiteListExpectFailure(sender: IKeyringPair, collectionId: number, address: string) {
698 await usingApi(async (api) => {
699 // Run the transaction
700 const tx = api.tx.nft.removeFromWhiteList(collectionId, address);
701 const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;
702 const result = getGenericResult(events);
703
704 // What to expect
705 // tslint:disable-next-line:no-unused-expression
706 expect(result.success).to.be.false;
707 });
708}
683709
684export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)710export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)
685 : Promise<ICollectionInterface | null> => {711 : Promise<ICollectionInterface | null> => {