1234567891011121314151617import {itSub, usingPlaygrounds, expect} from './util';181920const requiredPallets = [21 'balances',22 'balancesadapter',23 'common',24 'timestamp',25 'transactionpayment',26 'treasury',27 'statetriemigration',28 'structure',29 'system',30 'vesting',31 'parachainsystem',32 'parachaininfo',33 'evm',34 'evmcodersubstrate',35 'evmcontracthelpers',36 'evmmigration',37 'evmtransactionpayment',38 'ethereum',39 'fungible',40 'xcmpqueue',41 'polkadotxcm',42 'cumulusxcm',43 'dmpqueue',44 'inflation',45 'unique',46 'nonfungible',47 'charging',48 'configuration',49 'tokens',50 'xtokens',51 'maintenance',52];535455const consensusPallets = [56 'sudo',57 'aura',58 'auraext',59];6061describe('Pallet presence', () => {62 before(async () => {63 await usingPlaygrounds(async helper => {64 const chain = await helper.callRpc('api.rpc.system.chain', []);6566 const refungible = 'refungible';67 const foreignAssets = 'foreignassets';68 const appPromotion = 'apppromotion';69 const collatorSelection = ['authorship', 'session', 'collatorselection', 'identity'];70 const preimage = ['preimage'];71 const testUtils = 'testutils';7273 if(chain.eq('OPAL by UNIQUE')) {74 requiredPallets.push(75 refungible,76 foreignAssets,77 appPromotion,78 testUtils,79 ...collatorSelection,80 ...preimage,81 );82 } else if(chain.eq('QUARTZ by UNIQUE') || chain.eq('SAPPHIRE by UNIQUE')) {83 requiredPallets.push(84 refungible,85 appPromotion,86 foreignAssets,87 ...collatorSelection,88 ...preimage,89 );90 } else if(chain.eq('UNIQUE')) {91 92 requiredPallets.push(93 refungible,94 foreignAssets,95 appPromotion,96 );97 }98 });99 });100101 itSub('Required pallets are present', ({helper}) => {102 expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets].sort());103 });104105 itSub('Governance and consensus pallets are present', ({helper}) => {106 expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets].sort());107 });108109 itSub('No extra pallets are included', ({helper}) => {110 expect(helper.fetchAllPalletNames().sort()).to.be.deep.equal([...requiredPallets, ...consensusPallets].sort());111 });112});