mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-04-22 14:47:58 +00:00
feat: initial Pezkuwi Apps rebrand from polkadot-apps
Rebranded terminology: - Polkadot → Pezkuwi - Kusama → Dicle - Westend → Zagros - Rococo → PezkuwiChain - Substrate → Bizinikiwi - parachain → teyrchain Custom logos with Kurdistan brand colors (#e6007a → #86e62a): - bizinikiwi-hexagon.svg - sora-bizinikiwi.svg - hezscanner.svg - heztreasury.svg - pezkuwiscan.svg - pezkuwistats.svg - pezkuwiassembly.svg - pezkuwiholic.svg
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
// Copyright 2017-2025 @pezkuwi/test-support authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
import type { KeyringPair } from '@pezkuwi/keyring/types';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
|
||||
import { execute } from '@pezkuwi/test-support/transaction';
|
||||
|
||||
import { acceptMotion, fillTreasury, getMotion, proposeMotion } from './helpers.js';
|
||||
|
||||
export async function acceptCurator (api: ApiPromise, id: number, signer: KeyringPair): Promise<void> {
|
||||
await execute(api.tx.bounties.acceptCurator(id), signer);
|
||||
}
|
||||
|
||||
export async function awardBounty (api: ApiPromise, index: number, signer: KeyringPair): Promise<void> {
|
||||
await execute(api.tx.bounties.awardBounty(index, signer.address), signer);
|
||||
}
|
||||
|
||||
export async function claimBounty (api: ApiPromise, index: number, signer: KeyringPair): Promise<void> {
|
||||
await execute(api.tx.bounties.claimBounty(index), signer);
|
||||
}
|
||||
|
||||
export async function proposeBounty (api: ApiPromise, value: BN, title: string, signer: KeyringPair): Promise<number> {
|
||||
await execute(api.tx.bounties.proposeBounty(value, title), signer);
|
||||
const index = await api.query.bounties.bountyCount();
|
||||
|
||||
return index.toNumber() - 1;
|
||||
}
|
||||
|
||||
export async function proposeCurator (api: ApiPromise, index: number, signer: KeyringPair): Promise<void> {
|
||||
await proposeMotion(api, api.tx.bounties.proposeCurator(index, signer.address, 10), signer);
|
||||
const bountyProposal = await getMotion(api, index);
|
||||
|
||||
await acceptMotion(api, bountyProposal.hash, bountyProposal.votes?.index.toNumber() ?? 0);
|
||||
}
|
||||
|
||||
export async function approveBounty (api: ApiPromise, index: number, signer: KeyringPair): Promise<void> {
|
||||
await proposeMotion(api, api.tx.bounties.approveBounty(index), signer);
|
||||
|
||||
const bountyProposal = await getMotion(api, index);
|
||||
|
||||
await acceptMotion(api, bountyProposal.hash, bountyProposal.votes?.index.toNumber() ?? 0);
|
||||
await fillTreasury(api, signer);
|
||||
}
|
||||
Reference in New Issue
Block a user