git.delta.rocks / unique-network / refs/commits / 7d68ab6c6ac0

difftreelog

source

tests/src/setChainLimits.test.ts2.3 KiBsourcehistory
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {IKeyringPair} from '@polkadot/types/types';18import privateKey from './substrate/privateKey';19import usingApi from './substrate/substrate-api';20import {21  createCollectionExpectSuccess,22  addCollectionAdminExpectSuccess,23  setChainLimitsExpectFailure,24  IChainLimits,25} from './util/helpers';2627describe.skip('Negative Integration Test setChainLimits', () => {28  let alice: IKeyringPair;29  let bob: IKeyringPair;30  let dave: IKeyringPair;31  let limits: IChainLimits;3233  before(async () => {34    await usingApi(async () => {35      alice = privateKey('//Alice');36      bob = privateKey('//Bob');37      dave = privateKey('//Dave');38      limits = {39        collectionNumbersLimit : 1,40        accountTokenOwnershipLimit: 1,41        collectionsAdminsLimit: 1,42        customDataLimit: 1,43        nftSponsorTransferTimeout: 1,44        fungibleSponsorTransferTimeout: 1,45        refungibleSponsorTransferTimeout: 1,46        offchainSchemaLimit: 1,47        constOnChainSchemaLimit: 1,48      };49    });50  });5152  it('Collection owner cannot set chain limits', async () => {53    await createCollectionExpectSuccess({mode: {type: 'NFT'}});54    await setChainLimitsExpectFailure(alice, limits);55  });5657  it('Collection admin cannot set chain limits', async () => {58    const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});59    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);60    await setChainLimitsExpectFailure(bob, limits);61  });6263  it('Regular user cannot set chain limits', async () => {64    await setChainLimitsExpectFailure(dave, limits);65  });66});