git.delta.rocks / unique-network / refs/commits / 9a4bd0be1f67

difftreelog

Merge pull request #782 from UniqueNetwork/tests/app-promotion-forkless

ut-akuznetsov2022-12-16parents: #4b5ba1b #1621680.patch.diff
in: master
Increase app-promotion periods for full node

3 files changed

modifiedtests/src/app-promotion.test.tsdiffbeforeafterboth
--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -15,7 +15,9 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {IKeyringPair} from '@polkadot/types/types';
-import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util';
+import {
+  itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip, LOCKING_PERIOD, UNLOCKING_PERIOD,
+} from './util';
 import {DevUniqueHelper} from './util/playgrounds/unique.dev';
 import {itEth, expect, SponsoringMode} from './eth/util';
 
@@ -24,8 +26,9 @@
 let nominal: bigint;
 let palletAddress: string;
 let accounts: IKeyringPair[];
-const LOCKING_PERIOD = 8n; // 8 blocks of relay
-const UNLOCKING_PERIOD = 4n; // 4 blocks of parachain
+// App promotion periods:
+// LOCKING_PERIOD = 12 blocks of relay
+// UNLOCKING_PERIOD = 6 blocks of parachain
 
 describe('App promotion', () => {
   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
86export const MINIMUM_DONOR_FUND = 100_000n;86export const MINIMUM_DONOR_FUND = 100_000n;
87export const DONOR_FUNDING = 1_000_000n;87export const DONOR_FUNDING = 1_000_000n;
88
89// App-promotion periods:
90export const LOCKING_PERIOD = 12n; // 12 blocks of relay
91export const UNLOCKING_PERIOD = 6n; // 6 blocks of parachain
92
8893
89export enum Pallets {94export enum Pallets {