|
@@ -1,5 +1,5 @@
|
|
|
-import { Null, u32, u64, u128, bool, Option, BTreeSet, BTreeMap } from '@polkadot/types'
|
|
|
-import { JoyEnum, JoyStructDecorated, MemberId, AccountId } from './common'
|
|
|
+import { Null, u32, u64, bool, Option, BTreeSet, BTreeMap } from '@polkadot/types'
|
|
|
+import { JoyEnum, JoyStructDecorated, MemberId, AccountId, Balance, BlockNumber } from './common'
|
|
|
|
|
|
export class BountyId extends u64 {}
|
|
|
export class EntryId extends u64 {}
|
|
@@ -17,13 +17,13 @@ export class AssuranceContractType extends JoyEnum({
|
|
|
}) {}
|
|
|
|
|
|
export class FundingType_Perpetual extends JoyStructDecorated({
|
|
|
- target: u128, // Balance
|
|
|
+ target: Balance,
|
|
|
}) {}
|
|
|
|
|
|
export class FundingType_Limited extends JoyStructDecorated({
|
|
|
- min_funding_amount: u128, // Balance
|
|
|
- max_funding_amount: u128, // Balance
|
|
|
- funding_period: u32, // BlockNumber
|
|
|
+ min_funding_amount: Balance,
|
|
|
+ max_funding_amount: Balance,
|
|
|
+ funding_period: BlockNumber,
|
|
|
}) {}
|
|
|
|
|
|
export class FundingType extends JoyEnum({
|
|
@@ -35,15 +35,15 @@ export class BountyCreationParameters extends JoyStructDecorated({
|
|
|
oracle: BountyActor,
|
|
|
contract_type: AssuranceContractType,
|
|
|
creator: BountyActor,
|
|
|
- cherry: u128, // Balance
|
|
|
- entrant_stake: u128, // Balance
|
|
|
+ cherry: Balance,
|
|
|
+ entrant_stake: Balance,
|
|
|
funding_type: FundingType,
|
|
|
- work_period: u32, // BlockNumber
|
|
|
- judging_period: u32, // BlockNumber
|
|
|
+ work_period: BlockNumber,
|
|
|
+ judging_period: BlockNumber,
|
|
|
}) {}
|
|
|
|
|
|
export class OracleWorkEntryJudgment_Winner extends JoyStructDecorated({
|
|
|
- reward: u128, // Balance
|
|
|
+ reward: Balance,
|
|
|
}) {}
|
|
|
|
|
|
export class OracleWorkEntryJudgment extends JoyEnum({
|
|
@@ -56,11 +56,42 @@ export class OracleJudgment extends BTreeMap.with(EntryId, OracleWorkEntryJudgme
|
|
|
export class Entry extends JoyStructDecorated({
|
|
|
member_id: MemberId,
|
|
|
staking_account_id: AccountId,
|
|
|
- submitted_at: u32, // BlockNumber
|
|
|
+ submitted_at: BlockNumber,
|
|
|
work_submitted: bool,
|
|
|
oracle_judgment_result: Option.with(OracleJudgment),
|
|
|
}) {}
|
|
|
|
|
|
+export class BountyMilestone_Created extends JoyStructDecorated({
|
|
|
+ created_at: BlockNumber,
|
|
|
+ has_contributions: bool,
|
|
|
+}) {}
|
|
|
+
|
|
|
+export class BountyMilestone_BountyMaxFundingReached extends JoyStructDecorated({
|
|
|
+ max_funding_reached_at: BlockNumber,
|
|
|
+}) {}
|
|
|
+
|
|
|
+export class BountyMilestone_WorkSubmitted extends JoyStructDecorated({
|
|
|
+ work_period_started_at: BlockNumber,
|
|
|
+}) {}
|
|
|
+
|
|
|
+export class BountyMilestone_JudgmentSubmitted extends JoyStructDecorated({
|
|
|
+ successful_bounty: bool,
|
|
|
+}) {}
|
|
|
+
|
|
|
+export class BountyMilestone extends JoyEnum({
|
|
|
+ Created: BountyMilestone_Created,
|
|
|
+ BountyMaxFundingReached: BountyMilestone_BountyMaxFundingReached,
|
|
|
+ WorkSubmitted: BountyMilestone_WorkSubmitted,
|
|
|
+ JudgmentSubmitted: BountyMilestone_JudgmentSubmitted,
|
|
|
+}) {}
|
|
|
+
|
|
|
+export class Bounty extends JoyStructDecorated({
|
|
|
+ creation_params: BountyCreationParameters,
|
|
|
+ total_funding: Balance,
|
|
|
+ milestone: BountyMilestone,
|
|
|
+ active_work_entry_count: u32,
|
|
|
+}) {}
|
|
|
+
|
|
|
export const bountyTypes = {
|
|
|
BountyId,
|
|
|
EntryId,
|
|
@@ -75,6 +106,12 @@ export const bountyTypes = {
|
|
|
OracleWorkEntryJudgment,
|
|
|
OracleJudgment,
|
|
|
Entry,
|
|
|
+ BountyMilestone_Created,
|
|
|
+ BountyMilestone_BountyMaxFundingReached,
|
|
|
+ BountyMilestone_WorkSubmitted,
|
|
|
+ BountyMilestone_JudgmentSubmitted,
|
|
|
+ BountyMilestone,
|
|
|
+ Bounty,
|
|
|
}
|
|
|
|
|
|
export default bountyTypes
|