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
--- a/tests/src/collatorSelection.seqtest.ts
+++ b/tests/src/collatorSelection.seqtest.ts
@@ -64,6 +64,10 @@
     
     before(async function() {  
       await usingPlaygrounds(async (helper, privateKey) => {
+        // todo:collator see again if blocks start to be finalized in dev mode 
+        // Skip the collator block production in dev mode, since the blocks are sealed automatically.
+        if (await helper.arrange.isDevNode()) this.skip();
+
         alice = await privateKey('//Alice');
         bob = await privateKey('//Bob');
         charlie = await privateKey('//Charlie');
@@ -141,7 +145,7 @@
   
     after(async () => {
       await usingPlaygrounds(async (helper) => {
-        if (helper.fetchMissingPalletNames([Pallets.CollatorSelection]).length != 0) return;
+        if (await helper.arrange.isDevNode()) return;
 
         let nonce = await helper.chain.getNonce(superuser.address);
         await Promise.all([
@@ -161,7 +165,7 @@
   // todo:collator make sure that there is enough session time for a set of tests
   // 28 non-functioning collators, teehee.
 
-  describe.skip('Addition and removal of invulnerables', () => {
+  describe('Addition and removal of invulnerables', () => {
     before(async function() {
       await resetInvulnerables();
     });
@@ -261,7 +265,14 @@
         expect(await helper.collatorSelection.getInvulnerables()).to.have.all.members(invulnerables);
       });
     });
+  
+    after(async () => {
+      // eslint-disable-next-line require-await
+      await usingPlaygrounds(async (helper) => {
+        if (helper.fetchMissingPalletNames([Pallets.CollatorSelection]).length != 0) return;
     
-    // todo:collator after
+        // todo:collator after
+      });
+    });
   });
 });
\ No newline at end of file