git.delta.rocks / unique-network / refs/commits / 32c79dfc15ed

difftreelog

Increase app-promotion periods for full node

Max Andreev2022-12-16parent: #4b5ba1b.patch.diff
in: master
It works fine on dev node but fails on regular

3 files changed

modifiedtests/src/app-promotion.test.tsdiffbeforeafterboth
1616
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util';18import {
19 itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip, LOCKING_PERIOD, UNLOCKING_PERIOD,
20} from './util';
19import {DevUniqueHelper} from './util/playgrounds/unique.dev';21import {DevUniqueHelper} from './util/playgrounds/unique.dev';
20import {itEth, expect, SponsoringMode} from './eth/util';22import {itEth, expect, SponsoringMode} from './eth/util';
24let nominal: bigint;26let nominal: bigint;
25let palletAddress: string;27let palletAddress: string;
26let accounts: IKeyringPair[];28let accounts: IKeyringPair[];
29// App promotion periods:
27const LOCKING_PERIOD = 8n; // 8 blocks of relay30// LOCKING_PERIOD = 12n; // 8 blocks of relay
28const UNLOCKING_PERIOD = 4n; // 4 blocks of parachain31// UNLOCKING_PERIOD = 6n; // 4 blocks of parachain
2932
30describe('App promotion', () => {33describe('App promotion', () => {
31 before(async function () {34 before(async function () {
modifiedtests/src/util/globalSetup.tsdiffbeforeafterboth
--- a/tests/src/util/globalSetup.ts
+++ b/tests/src/util/globalSetup.ts
@@ -1,7 +1,9 @@
 // Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
 // SPDX-License-Identifier: Apache-2.0
 
-import {usingPlaygrounds, Pallets, DONOR_FUNDING, MINIMUM_DONOR_FUND} from './index';
+import {
+  usingPlaygrounds, Pallets, DONOR_FUNDING, MINIMUM_DONOR_FUND, LOCKING_PERIOD, UNLOCKING_PERIOD,
+} from './index';
 import * as path from 'path';
 import {promises as fs} from 'fs';
 
@@ -21,10 +23,6 @@
       // 3. Configure App Promotion 
       const missingPallets = helper.fetchMissingPalletNames([Pallets.AppPromotion]);
       if (missingPallets.length === 0) {
-        // TODO: move to config file
-        const LOCKING_PERIOD = 8n; // 8 blocks of relay
-        const UNLOCKING_PERIOD = 4n; // 4 blocks of parachain
-
         const superuser = await privateKey('//Alice');
         const palletAddress = helper.arrange.calculatePalletAddress('appstake');
         const palletAdmin = await privateKey('//PromotionAdmin');
modifiedtests/src/util/index.tsdiffbeforeafterboth
--- a/tests/src/util/index.ts
+++ b/tests/src/util/index.ts
@@ -86,6 +86,11 @@
 export const MINIMUM_DONOR_FUND = 100_000n;
 export const DONOR_FUNDING = 1_000_000n;
 
+// App-promotion periods:
+export const LOCKING_PERIOD = 12n; // 8 blocks of relay
+export const UNLOCKING_PERIOD = 6n; // 4 blocks of parachain
+
+
 export enum Pallets {
   Inflation = 'inflation',
   RmrkCore = 'rmrkcore',