123456import { ApiPromise } from '@polkadot/api';7import { expect } from 'chai';8import usingApi from './substrate/substrate-api';910function getModuleNames(api: ApiPromise): string[] {11 return api.runtimeMetadata.asLatest.modules.map(m => m.name.toString().toLowerCase());12}131415const requiredPallets = [16 'nft', 'inflation', 'balances', 'contracts', 'randomnesscollectiveflip', 'system', 'timestamp', 'transactionpayment', 'treasury', 'vesting', 'evm', 'ethereum',17 'scheduler', 'nftpayment', 'charging',18];192021const consensusPallets = [22 'sudo', 'aura',23];2425describe('Pallet presence', () => {26 it('Required pallets are present', async () => {27 await usingApi(async api => {28 for (let i=0; i<requiredPallets.length; i++) {29 expect(getModuleNames(api)).to.include(requiredPallets[i]);30 }31 });32 });33 it('Governance and consensus pallets are present', async () => {34 await usingApi(async api => {35 for (let i=0; i<consensusPallets.length; i++) {36 expect(getModuleNames(api)).to.include(consensusPallets[i]);37 }38 });39 });40 it('No extra pallets are included', async () => {41 await usingApi(async api => {42 expect(getModuleNames(api).length).to.be.equal(requiredPallets.length + consensusPallets.length);43 });44 });45});