git.delta.rocks / unique-network / refs/commits / 798055ce59b0

difftreelog

source

tests/src/setChainLimits.test.ts1.7 KiBsourcehistory
1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56import {IKeyringPair} from '@polkadot/types/types';7import privateKey from './substrate/privateKey';8import usingApi from './substrate/substrate-api';9import {10  createCollectionExpectSuccess,11  addCollectionAdminExpectSuccess,12  setChainLimitsExpectFailure,13  IChainLimits,14} from './util/helpers';1516describe.skip('Negative Integration Test setChainLimits', () => {17  let alice: IKeyringPair;18  let bob: IKeyringPair;19  let dave: IKeyringPair;20  let limits: IChainLimits;2122  before(async () => {23    await usingApi(async () => {24      alice = privateKey('//Alice');25      bob = privateKey('//Bob');26      dave = privateKey('//Dave');27      limits = {28        collectionNumbersLimit : 1,29        accountTokenOwnershipLimit: 1,30        collectionsAdminsLimit: 1,31        customDataLimit: 1,32        nftSponsorTransferTimeout: 1,33        fungibleSponsorTransferTimeout: 1,34        refungibleSponsorTransferTimeout: 1,35        offchainSchemaLimit: 1,36        variableOnChainSchemaLimit: 1,37        constOnChainSchemaLimit: 1,38      };39    });40  });4142  it('Collection owner cannot set chain limits', async () => {43    await createCollectionExpectSuccess({mode: {type: 'NFT'}});44    await setChainLimitsExpectFailure(alice, limits);45  });4647  it('Collection admin cannot set chain limits', async () => {48    const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});49    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);50    await setChainLimitsExpectFailure(bob, limits);51  });5253  it('Regular user cannot set chain limits', async () => {54    await setChainLimitsExpectFailure(dave, limits);55  });56});