git.delta.rocks / unique-network / refs/commits / 1505aad9ef56

difftreelog

test fix pallet presence

Yaroslav Bolyukin2023-03-24parent: #5667e2a.patch.diff
in: master

2 files changed

modifiedtests/src/pallet-presence.test.tsdiffbeforeafterboth
20const requiredPallets = [20const requiredPallets = [
21 'balances',21 'balances',
22 'common',22 'common',
23 'randomnesscollectiveflip',
24 'timestamp',23 'timestamp',
25 'transactionpayment',24 'transactionpayment',
26 'treasury',25 'treasury',
98 });97 });
9998
100 itSub('Required pallets are present', ({helper}) => {99 itSub('Required pallets are present', ({helper}) => {
101 expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets]);100 expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets].sort());
102 });101 });
103102
104 itSub('Governance and consensus pallets are present', ({helper}) => {103 itSub('Governance and consensus pallets are present', ({helper}) => {
105 expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets]);104 expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets].sort());
106 });105 });
107106
108 itSub('No extra pallets are included', ({helper}) => {107 itSub('No extra pallets are included', ({helper}) => {
modifiedtests/src/util/playgrounds/unique.tsdiffbeforeafterboth
736736
737 fetchAllPalletNames(): string[] {737 fetchAllPalletNames(): string[] {
738 if(this.api === null) throw Error('API not initialized');738 if(this.api === null) throw Error('API not initialized');
739 return this.api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase());739 return this.api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase()).sort();
740 }740 }
741741
742 fetchMissingPalletNames(requiredPallets: string[]): string[] {742 fetchMissingPalletNames(requiredPallets: string[]): string[] {