git.delta.rocks / unique-network / refs/commits / 0caf783d73c3

difftreelog

fix use plain node names instead of test account names

Daniel Shiposha2023-09-08parent: #0e9500c.patch.diff
in: master

2 files changed

modified.baedeker/collator-selection.jsonnetdiffbeforeafterboth
before · .baedeker/collator-selection.jsonnet
1local2m = import 'baedeker-library/mixin/spec.libsonnet',3;45local relay = {6	name: 'relay',7	bin: 'bin/polkadot',8	validatorIdAssignment: 'staking',9	spec: {Genesis:{10		chain: 'rococo-local',11		modify:: m.genericRelay($),12	}},13	nodes: {14		[name]: {15			bin: $.bin,16			wantedKeys: 'relay',17		},18		for name in ['alice', 'bob', 'charlie', 'dave', 'eve']19	},20};2122local unique = {23	name: 'unique',24	bin: 'bin/unique',25	paraId: 1001,26	spec: {Genesis:{27		modify:: m.genericPara($),28	}},29	nodes: {30		[name]: {31			bin: $.bin,32			wantedKeys: 'para',33		},34		for name in ['alice', 'bob', 'charlie', 'dave']35	},36};3738relay + {39	parachains: {40		[para.name]: para,41		for para in [unique]42	},43}
after · .baedeker/collator-selection.jsonnet
1local2m = import 'baedeker-library/mixin/spec.libsonnet',3;45local relay = {6	name: 'relay',7	bin: 'bin/polkadot',8	validatorIdAssignment: 'staking',9	spec: {Genesis:{10		chain: 'rococo-local',11		modify:: m.genericRelay($),12	}},13	nodes: {14		[name]: {15			bin: $.bin,16			wantedKeys: 'relay',17		},18		for name in ['alice', 'bob', 'charlie', 'dave', 'eve']19	},20};2122local unique = {23	name: 'unique',24	bin: 'bin/unique',25	paraId: 1001,26	spec: {Genesis:{27		modify:: m.genericPara($),28	}},29	nodes: {30		[name]: {31			bin: $.bin,32			wantedKeys: 'para',33		},34		for name in ['alpha', 'beta', 'gamma', 'delta']35	},36};3738relay + {39	parachains: {40		[para.name]: para,41		for para in [unique]42	},43}
modifiedtests/src/collator-selection/collatorSelection.seqtest.tsdiffbeforeafterboth
--- a/tests/src/collator-selection/collatorSelection.seqtest.ts
+++ b/tests/src/collator-selection/collatorSelection.seqtest.ts
@@ -33,10 +33,10 @@
 
 async function getInitialInvulnerables() {
   return await Promise.all([
-    nodeAddress('Alice'),
-    nodeAddress('Bob'),
-    nodeAddress('Charlie'),
-    nodeAddress('Dave'),
+    nodeAddress('alpha'),
+    nodeAddress('beta'),
+    nodeAddress('gamma'),
+    nodeAddress('delta'),
   ]);
 }
 
@@ -84,11 +84,11 @@
 
   describe('Dynamic shuffling of collators', () => {
     // These two are the default invulnerables, and should return to be invulnerables after this suite.
-    let aliceNode: string;
-    let bobNode: string;
+    let alphaNode: string;
+    let betaNode: string;
 
-    let charlieNode: string;
-    let daveNode: string;
+    let gammaNode: string;
+    let deltaNode: string;
 
     before(async function() {
       await usingPlaygrounds(async (helper, privateKey) => {
@@ -96,11 +96,11 @@
         // Skip the collator block production in dev mode, since the blocks are sealed automatically.
         if(await helper.arrange.isDevNode()) this.skip();
 
-        [aliceNode, bobNode, charlieNode, daveNode] = await getInitialInvulnerables();
+        [alphaNode, betaNode, gammaNode, deltaNode] = await getInitialInvulnerables();
 
         const invulnerables = await helper.collatorSelection.getInvulnerables();
         expect(invulnerables.length, 'Invalid initial invulnerables number').to.be.equal(4);
-        expect(invulnerables, 'Invalid initial invulnerables').containSubset([aliceNode, bobNode, charlieNode, daveNode]);
+        expect(invulnerables, 'Invalid initial invulnerables').containSubset([alphaNode, betaNode, gammaNode, deltaNode]);
       });
     });
 
@@ -109,23 +109,23 @@
 
       nonce = await helper.chain.getNonce(superuser.address);
       await expect(Promise.all([
-        helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [aliceNode], true, {nonce: nonce++}),
-        helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [bobNode], true, {nonce: nonce++}),
+        helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [alphaNode], true, {nonce: nonce++}),
+        helper.getSudo().executeExtrinsic(superuser, 'api.tx.collatorSelection.removeInvulnerable', [betaNode], true, {nonce: nonce++}),
       ])).to.be.fulfilled;
 
       const newInvulnerables = await helper.collatorSelection.getInvulnerables();
-      expect(newInvulnerables).to.contain(charlieNode).and.contain(daveNode).and.be.length(2);
+      expect(newInvulnerables).to.contain(gammaNode).and.contain(deltaNode).and.be.length(2);
 
       await helper.wait.newSessions(2);
 
       const newValidators = await helper.callRpc('api.query.session.validators');
-      expect(newValidators).to.contain(charlieNode).and.contain(daveNode).and.be.length(2);
+      expect(newValidators).to.contain(gammaNode).and.contain(deltaNode).and.be.length(2);
 
       const lastBlockNumber = await helper.chain.getLatestBlockNumber();
       await helper.wait.newBlocks(1);
-      const lastCharlieBlock = (await helper.callRpc('api.query.collatorSelection.lastAuthoredBlock', [charlieNode])).toNumber();
-      const lastDaveBlock = (await helper.callRpc('api.query.collatorSelection.lastAuthoredBlock', [daveNode])).toNumber();
-      expect(lastCharlieBlock >= lastBlockNumber || lastDaveBlock >= lastBlockNumber).to.be.true;
+      const lastGammaBlock = (await helper.callRpc('api.query.collatorSelection.lastAuthoredBlock', [gammaNode])).toNumber();
+      const lastDeltaBlock = (await helper.callRpc('api.query.collatorSelection.lastAuthoredBlock', [deltaNode])).toNumber();
+      expect(lastGammaBlock >= lastBlockNumber || lastDeltaBlock >= lastBlockNumber).to.be.true;
     });
 
     after(async () => {