1234567891011121314151617import {itSub, usingPlaygrounds, expect} from './util/index.js';181920const requiredPallets = [21 'balances',22 'balancesadapter',23 'common',24 'timestamp',25 'transactionpayment',26 'treasury',27 'statetriemigration',28 'structure',29 'system',30 'utility',31 'vesting',32 'parachainsystem',33 'parachaininfo',34 'evm',35 'evmcodersubstrate',36 'evmcontracthelpers',37 'evmmigration',38 'evmtransactionpayment',39 'ethereum',40 'fungible',41 'xcmpqueue',42 'polkadotxcm',43 'cumulusxcm',44 'dmpqueue',45 'inflation',46 'unique',47 'nonfungible',48 'charging',49 'configuration',50 'tokens',51 'xtokens',52 'maintenance',53];545556const consensusPallets = [57 'sudo',58 'aura',59 'auraext',60];6162describe('Pallet presence', () => {63 before(async () => {64 await usingPlaygrounds(async helper => {65 const runtimeVersion = await helper.callRpc('api.rpc.state.getRuntimeVersion', []);66 const chain = runtimeVersion.specName;6768 const refungible = 'refungible';69 const foreignAssets = 'foreignassets';70 const appPromotion = 'apppromotion';71 const collatorSelection = ['authorship', 'session', 'collatorselection'];72 const preimage = ['preimage'];73 const governance = [74 'council',75 'councilmembership',76 'democracy',77 'fellowshipcollective',78 'fellowshipreferenda',79 'origins',80 'scheduler',81 'technicalcommittee',82 'technicalcommitteemembership',83 'identity',84 ];85 const testUtils = 'testutils';8687 if(chain.eq('opal')) {88 requiredPallets.push(89 refungible,90 foreignAssets,91 appPromotion,92 testUtils,93 ...collatorSelection,94 ...preimage,95 ...governance,96 );97 } else if(chain.eq('quartz') || chain.eq('sapphire')) {98 requiredPallets.push(99 refungible,100 appPromotion,101 foreignAssets,102 ...collatorSelection,103 ...preimage,104 ...governance,105 );106 } else if(chain.eq('unique')) {107 108 requiredPallets.push(109 refungible,110 foreignAssets,111 appPromotion,112 ...preimage,113 ...governance,114 );115 }116 });117 });118119 itSub('Required pallets are present', ({helper}) => {120 expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets].sort());121 });122123 itSub('Governance and consensus pallets are present', ({helper}) => {124 expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets].sort());125 });126127 itSub('No extra pallets are included', ({helper}) => {128 expect(helper.fetchAllPalletNames().sort()).to.be.deep.equal([...requiredPallets, ...consensusPallets].sort());129 });130});