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 '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'];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 'identity',83 ];84 const testUtils = 'testutils';8586 if(chain.eq('opal')) {87 requiredPallets.push(88 refungible,89 foreignAssets,90 appPromotion,91 testUtils,92 ...collatorSelection,93 ...preimage,94 ...governance,95 );96 } else if(chain.eq('quartz') || chain.eq('sapphire')) {97 requiredPallets.push(98 refungible,99 appPromotion,100 foreignAssets,101 ...collatorSelection,102 ...preimage,103 ...governance,104 );105 } else if(chain.eq('unique')) {106 107 requiredPallets.push(108 refungible,109 foreignAssets,110 appPromotion,111 ...preimage,112 ...governance,113 );114 }115 });116 });117118 itSub('Required pallets are present', ({helper}) => {119 expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets].sort());120 });121122 itSub('Governance and consensus pallets are present', ({helper}) => {123 expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets].sort());124 });125126 itSub('No extra pallets are included', ({helper}) => {127 expect(helper.fetchAllPalletNames().sort()).to.be.deep.equal([...requiredPallets, ...consensusPallets].sort());128 });129});