git.delta.rocks / unique-network / refs/commits / 218082ec0405

difftreelog

tests(collator-selection): further fixes

Fahrrader2022-12-21parent: #33d3cd0.patch.diff
in: master

2 files changed

modifiedpallets/collator-selection/src/tests.rsdiffbeforeafterboth
108105
109 // cannot remove an invulnerable if there would be 0 invulnerables.106 // cannot remove an invulnerable if there would be 0 invulnerables.
110 assert_noop!(107 assert_noop!(
111 CollatorSelection::add_invulnerable(108 CollatorSelection::remove_invulnerable(RuntimeOrigin::signed(RootAccount::get()), 1),
112 RuntimeOrigin::signed(RootAccount::get()),
113 1
114 ),
115 Error::<Test>::NotInvulnerable109 Error::<Test>::TooFewInvulnerables
116 );110 );
117 });111 });
118}112}
modifiedtests/src/collatorSelection.seqtest.tsdiffbeforeafterboth
64 64
65 before(async function() { 65 before(async function() {
66 await usingPlaygrounds(async (helper, privateKey) => {66 await usingPlaygrounds(async (helper, privateKey) => {
67 // todo:collator see again if blocks start to be finalized in dev mode
68 // Skip the collator block production in dev mode, since the blocks are sealed automatically.
69 if (await helper.arrange.isDevNode()) this.skip();
70
67 alice = await privateKey('//Alice');71 alice = await privateKey('//Alice');
68 bob = await privateKey('//Bob');72 bob = await privateKey('//Bob');
141 145
142 after(async () => {146 after(async () => {
143 await usingPlaygrounds(async (helper) => {147 await usingPlaygrounds(async (helper) => {
144 if (helper.fetchMissingPalletNames([Pallets.CollatorSelection]).length != 0) return;148 if (await helper.arrange.isDevNode()) return;
145149
146 let nonce = await helper.chain.getNonce(superuser.address);150 let nonce = await helper.chain.getNonce(superuser.address);
147 await Promise.all([151 await Promise.all([
161 // todo:collator make sure that there is enough session time for a set of tests165 // todo:collator make sure that there is enough session time for a set of tests
162 // 28 non-functioning collators, teehee.166 // 28 non-functioning collators, teehee.
163167
164 describe.skip('Addition and removal of invulnerables', () => {168 describe('Addition and removal of invulnerables', () => {
165 before(async function() {169 before(async function() {
166 await resetInvulnerables();170 await resetInvulnerables();
167 });171 });
262 });266 });
263 });267 });
264 268
269 after(async () => {
270 // eslint-disable-next-line require-await
271 await usingPlaygrounds(async (helper) => {
272 if (helper.fetchMissingPalletNames([Pallets.CollatorSelection]).length != 0) return;
273
265 // todo:collator after274 // todo:collator after
275 });
276 });
266 });277 });
267});278});