Skip to content

Commit 9f01b42

Browse files
committed
chore: make sure we activated mn_rr
1 parent c6bfcc1 commit 9f01b42

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

packages/dashmate/src/listr/tasks/setup/local/configureCoreTaskFactory.js

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Listr } from 'listr2';
22
import { Observable } from 'rxjs';
33
import DashCoreLib from '@dashevo/dashcore-lib';
44
import waitForNodesToHaveTheSameHeight from '../../../../core/waitForNodesToHaveTheSameHeight.js';
5-
import waitForNodesToHaveTheSameSporks from '../../../../core/waitForNodesToHaveTheSameSporks.js';
65

76
import { NETWORK_LOCAL, HPMN_COLLATERAL_AMOUNT } from '../../../../constants.js';
87

@@ -124,7 +123,7 @@ export default function configureCoreTaskFactory(
124123
},
125124
},
126125
{
127-
title: 'Activating forks',
126+
title: 'Activating v19 and v20',
128127
task: () => new Observable(async (observer) => {
129128
const dip3ActivationHeight = 901;
130129
const blocksToGenerateInOneStep = 10;
@@ -309,6 +308,47 @@ export default function configureCoreTaskFactory(
309308
WAIT_FOR_NODES_TIMEOUT,
310309
),
311310
},
311+
{
312+
title: 'Activating v21 fork',
313+
task: () => new Observable(async (observer) => {
314+
const dip3ActivationHeight = 1001;
315+
const blocksToGenerateInOneStep = 10;
316+
317+
let blocksGenerated = 0;
318+
let {
319+
result: currentBlockHeight,
320+
} = await ctx.coreService.getRpcClient().getBlockCount();
321+
322+
do {
323+
({
324+
result: currentBlockHeight,
325+
} = await ctx.coreService.getRpcClient().getBlockCount());
326+
327+
await generateBlocks(
328+
ctx.coreService,
329+
blocksToGenerateInOneStep,
330+
NETWORK_LOCAL,
331+
// eslint-disable-next-line no-loop-func
332+
(blocks) => {
333+
blocksGenerated += blocks;
334+
335+
observer.next(`${blocksGenerated} blocks generated`);
336+
},
337+
);
338+
} while (dip3ActivationHeight > currentBlockHeight);
339+
340+
observer.complete();
341+
342+
return this;
343+
}),
344+
},
345+
{
346+
title: 'Wait for nodes to have the same height',
347+
task: () => waitForNodesToHaveTheSameHeight(
348+
ctx.rpcClients,
349+
WAIT_FOR_NODES_TIMEOUT,
350+
),
351+
},
312352
{
313353
title: 'Stopping nodes',
314354
task: async () => (Promise.all(

0 commit comments

Comments
 (0)