mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-10-21 03:06:22 +00:00
- api/constants: only PEZKUWI_GENESIS and ZAGROS_GENESIS remain. The Zagros value was a placeholder from before its launch; it is now the live chain's genesis (0x1b0b4727…2cd5, measured). - Inflation, proposal thresholds and governance tracks keep the Pezkuwi entries; the Dicle, Kulupu, Cere, Vara, Joystream, zkVerify, Dock, Neatcoin and NFTMart ones go, as do the dicle tracks. - getTeleportWeight was used nowhere: removed. - page-society: the Dicle-only "design samples" button and its canary drawing go, with their table column. - page-assets: the next-id rule keyed on Polkadot's and Kusama's asset hub genesis never matched a Pezkuwi chain; removed, no change there. - ParaLink: the Subscan link went to scan.pezkuwichain.io, which does not resolve; removed (coretime keeps the homepage link). - typesBundle generator: no unused sort-keys directive when empty.
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/apps-config authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { ApiPromise } from '@pezkuwi/api';
|
|
|
|
import { PEZKUWI_GENESIS } from '../constants.js';
|
|
|
|
// normal fast-track proposals
|
|
const FAST_TRACK: Record<string, number> = {
|
|
default: 2 / 3
|
|
};
|
|
|
|
// in the case where block < fastTrackVotingPeriod
|
|
const FAST_TRACK_NO_DELAY: Record<string, number> = {
|
|
default: 1
|
|
};
|
|
|
|
const PROPOSE: Record<string, number> = {
|
|
[PEZKUWI_GENESIS]: 3 / 5,
|
|
default: 1 / 2
|
|
};
|
|
|
|
const SLASH: Record<string, number> = {
|
|
[PEZKUWI_GENESIS]: 3 / 4,
|
|
default: 1 / 2
|
|
};
|
|
|
|
const TREASURY: Record<string, number> = {
|
|
[PEZKUWI_GENESIS]: 3 / 5,
|
|
default: 3 / 5
|
|
};
|
|
|
|
export function getFastTrackThreshold (api: ApiPromise, isDefault: boolean): number {
|
|
return isDefault
|
|
? (FAST_TRACK[api.genesisHash.toHex()] || FAST_TRACK.default)
|
|
: (FAST_TRACK_NO_DELAY[api.genesisHash.toHex()] || FAST_TRACK_NO_DELAY.default);
|
|
}
|
|
|
|
export function getProposalThreshold (api: ApiPromise): number {
|
|
return PROPOSE[api.genesisHash.toHex()] || PROPOSE.default;
|
|
}
|
|
|
|
export function getSlashProposalThreshold (api: ApiPromise): number {
|
|
return SLASH[api.genesisHash.toHex()] || SLASH.default;
|
|
}
|
|
|
|
export function getTreasuryProposalThreshold (api: ApiPromise): number {
|
|
return TREASURY[api.genesisHash.toHex()] || TREASURY.default;
|
|
}
|