difftreelog
repair auto merge
in: master
1 file changed
tests/src/util/helpers.tsdiffbeforeafterboth100 checkMsgSysMethod: string;100 checkMsgSysMethod: string;101}101}102103export interface IFungibleTokenDataType {104 Value: number;105}106107export interface IChainLimits {108 CollectionNumbersLimit: number;109 AccountTokenOwnershipLimit: number;110 CollectionsAdminsLimit: number;111 CustomDataLimit: number;112 NftSponsorTransferTimeout: number;113 FungibleSponsorTransferTimeout: number;114 RefungibleSponsorTransferTimeout: number;115 OffchainSchemaLimit: number;116 VariableOnChainSchemaLimit: number;117 ConstOnChainSchemaLimit: number;118}102119103export interface IReFungibleTokenDataType {120export interface IReFungibleTokenDataType {104 Owner: IReFungibleOwner[];121 Owner: IReFungibleOwner[];457 });474 });458}475}459476460export async function removeCollectionSponsorExpectFailure(collectionId: number) {477export async function removeCollectionSponsorExpectFailure(collectionId: number, senderSeed = '//Alice') {461 await usingApi(async (api) => {478 await usingApi(async (api) => {462479463 // Run the transaction480 // Run the transaction464 const alicePrivateKey = privateKey('//Alice');481 const alicePrivateKey = privateKey(senderSeed);465 const tx = api.tx.nft.removeCollectionSponsor(collectionId);482 const tx = api.tx.nft.removeCollectionSponsor(collectionId);466 await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;483 await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;467 });484 });770 });787 });771}788}789790export async function addCollectionAdminExpectSuccess(sender: IKeyringPair, collectionId: number, address: IKeyringPair) {791 await usingApi(async (api) => {792 const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, normalizeAccountId(address.address));793 const events = await submitTransactionAsync(sender, changeAdminTx);794 const result = getCreateCollectionResult(events);795 expect(result.success).to.be.true;796 });797}772798773export async function799export async function774scheduleTransferExpectSuccess(800scheduleTransferExpectSuccess(1047 });1073 });1048}1074}10751076export async function setChainLimitsExpectFailure(sender: IKeyringPair, limits: IChainLimits) {1077 await usingApi(async (api) => {1078 // Run the transaction1079 const tx = api.tx.nft.setChainLimits(limits);1080 const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;1081 const result = getCreateCollectionResult(events);1082 // tslint:disable-next-line:no-unused-expression1083 expect(result.success).to.be.false;1084 });1085}104910861050export async function isWhitelisted(collectionId: number, address: string) {1087export async function isWhitelisted(collectionId: number, address: string) {1051 let whitelisted = false;1088 let whitelisted = false;