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 runtimeVersion = await helper.callRpc('api.rpc.state.getRuntimeVersion', []);65 const chain = runtimeVersion.specName;6667 const refungible = 'refungible';68 const foreignAssets = 'foreignassets';69 const appPromotion = 'apppromotion';70 const collatorSelection = ['authorship', 'session', 'collatorselection', 'identity'];71 const preimage = ['preimage'];72 const governance = [73 'council',74 'councilmembership',75 'democracy',76 'fellowshipcollective',77 'fellowshipreferenda',78 'origins',79 'scheduler',80 'technicalcommittee',81 'technicalcommitteemembership',82 ];83 const testUtils = 'testutils';8485 if(chain.eq('opal')) {86 requiredPallets.push(87 refungible,88 foreignAssets,89 appPromotion,90 testUtils,91 ...collatorSelection,92 ...preimage,93 ...governance,94 );95 } else if(chain.eq('quartz') || chain.eq('sapphire')) {96 requiredPallets.push(97 refungible,98 appPromotion,99 foreignAssets,100 ...collatorSelection,101 ...preimage,102 ...governance,103 );104 } else if(chain.eq('unique')) {105 106 requiredPallets.push(107 refungible,108 foreignAssets,109 appPromotion,110 );111 }112 });113 });114115 itSub('Required pallets are present', ({helper}) => {116 expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets].sort());117 });118119 itSub('Governance and consensus pallets are present', ({helper}) => {120 expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets].sort());121 });122123 itSub('No extra pallets are included', ({helper}) => {124 expect(helper.fetchAllPalletNames().sort()).to.be.deep.equal([...requiredPallets, ...consensusPallets].sort());125 });126});