git.delta.rocks / unique-network / refs/commits / 82ad2e13866f

difftreelog

repair auto merge

Igor Kozyrev2021-09-01parent: #f071285.patch.diff
in: master

1 file changed

modifiedtests/src/util/helpers.tsdiffbeforeafterboth
100 checkMsgSysMethod: string;100 checkMsgSysMethod: string;
101}101}
102
103export interface IFungibleTokenDataType {
104 Value: number;
105}
106
107export 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}
102119
103export interface IReFungibleTokenDataType {120export interface IReFungibleTokenDataType {
104 Owner: IReFungibleOwner[];121 Owner: IReFungibleOwner[];
457 });474 });
458}475}
459476
460export async function removeCollectionSponsorExpectFailure(collectionId: number) {477export async function removeCollectionSponsorExpectFailure(collectionId: number, senderSeed = '//Alice') {
461 await usingApi(async (api) => {478 await usingApi(async (api) => {
462479
463 // Run the transaction480 // Run the transaction
464 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}
789
790export 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}
772798
773export async function799export async function
774scheduleTransferExpectSuccess(800scheduleTransferExpectSuccess(
1047 });1073 });
1048}1074}
1075
1076export async function setChainLimitsExpectFailure(sender: IKeyringPair, limits: IChainLimits) {
1077 await usingApi(async (api) => {
1078 // Run the transaction
1079 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-expression
1083 expect(result.success).to.be.false;
1084 });
1085}
10491086
1050export async function isWhitelisted(collectionId: number, address: string) {1087export async function isWhitelisted(collectionId: number, address: string) {
1051 let whitelisted = false;1088 let whitelisted = false;