Browse Source

Types updates, merge updates, post-test fixes

Leszek Wiesner 4 years ago
parent
commit
294e1db8ce

+ 13 - 20
cli/src/Api.ts

@@ -204,14 +204,11 @@ export default class Api {
       throw new Error(`Group member profile not found! (member id: ${memberId.toNumber()})`)
     }
 
-    let stake: Balance | undefined
-    if (worker.staking_account_id.isSome) {
-      stake = await this.fetchStake(worker.staking_account_id.unwrap())
-    }
+    const stake = await this.fetchStake(worker.staking_account_id)
 
     const reward: Reward = {
-      valuePerBlock: worker.reward_per_block.unwrapOrDefault(),
-      totalMissed: worker.missed_reward.unwrapOrDefault(),
+      valuePerBlock: worker.reward_per_block.unwrapOr(undefined),
+      totalMissed: worker.missed_reward.unwrapOr(undefined),
     }
 
     return {
@@ -291,8 +288,9 @@ export default class Api {
       member: await this.membershipById(application.member_id),
       roleAccout: application.role_account_id,
       rewardAccount: application.reward_account_id,
-      stakingAccount: application.staking_account_id.unwrapOr(undefined),
+      stakingAccount: application.staking_account_id,
       descriptionHash: application.description_hash.toString(),
+      openingId: application.opening_id.toNumber(),
     }
   }
 
@@ -301,18 +299,15 @@ export default class Api {
     return await this.fetchApplicationDetails(applicationId, application)
   }
 
-  protected async groupOpeningApplications(
-    group: WorkingGroups /*, openingId: number */
-  ): Promise<ApplicationDetails[]> {
+  protected async groupOpeningApplications(group: WorkingGroups, openingId: number): Promise<ApplicationDetails[]> {
     const applicationEntries = await this.entriesByIds<ApplicationId, Application>(
       this.workingGroupApiQuery(group).applicationById
     )
 
     return Promise.all(
       applicationEntries
-        // TODO: No relation between application and opening yet!
-        // .filter(([, /* id */ wgApplication]) => wgApplication.opening_id.eqn(wgOpeningId))
-        .map(([id, wgApplication]) => this.fetchApplicationDetails(id.toNumber(), wgApplication))
+        .filter(([, application]) => application.opening_id.eqn(openingId))
+        .map(([id, application]) => this.fetchApplicationDetails(id.toNumber(), application))
     )
   }
 
@@ -333,14 +328,12 @@ export default class Api {
   }
 
   async fetchOpeningDetails(group: WorkingGroups, opening: Opening, openingId: number): Promise<OpeningDetails> {
-    const applications = await this.groupOpeningApplications(group)
+    const applications = await this.groupOpeningApplications(group, openingId)
     const type = opening.opening_type
-    const stake = opening.stake_policy.isSome
-      ? {
-          unstakingPeriod: opening.stake_policy.unwrap().leaving_unstaking_period.toNumber(),
-          value: opening.stake_policy.unwrap().stake_amount,
-        }
-      : undefined
+    const stake = {
+      unstakingPeriod: opening.stake_policy.leaving_unstaking_period.toNumber(),
+      value: opening.stake_policy.stake_amount,
+    }
 
     return {
       openingId,

+ 7 - 6
cli/src/Types.ts

@@ -45,8 +45,8 @@ export const AvailableGroups: readonly WorkingGroups[] = [
 ] as const
 
 export type Reward = {
-  totalMissed: Balance
-  valuePerBlock: Balance
+  totalMissed?: Balance
+  valuePerBlock?: Balance
 }
 
 // Compound working group types
@@ -55,22 +55,23 @@ export type GroupMember = {
   memberId: MemberId
   roleAccount: AccountId
   profile: Membership
-  stake?: Balance
-  reward?: Reward
+  stake: Balance
+  reward: Reward
 }
 
 export type ApplicationDetails = {
   applicationId: number
   member: Membership | null
   roleAccout: AccountId
-  stakingAccount?: AccountId
+  stakingAccount: AccountId
   rewardAccount: AccountId
   descriptionHash: string
+  openingId: number
 }
 
 export type OpeningDetails = {
   openingId: number
-  stake?: {
+  stake: {
     value: Balance
     unstakingPeriod: number
   }

+ 7 - 3
cli/src/base/AccountsCommandBase.ts

@@ -225,7 +225,9 @@ export default abstract class AccountsCommandBase extends ApiCommandBase {
     let isPassValid = false
     while (!isPassValid) {
       try {
-        const password = await this.promptForPassword(message)
+        const password = await this.promptForPassword(
+          message || `Enter ${pair.meta.name ? pair.meta.name : pair.address} account password`
+        )
         pair.decodePkcs8(password)
         isPassValid = true
       } catch (e) {
@@ -358,7 +360,7 @@ export default abstract class AccountsCommandBase extends ApiCommandBase {
     this.log(`Required stake: ${formatBalance(stakeValue)}`)
     let stakingAccount: string
     while (true) {
-      stakingAccount = await this.promptForAnyAddress()
+      stakingAccount = await this.promptForAnyAddress('Choose staking account')
       const { balances } = await this.getApi().getAccountSummary(stakingAccount)
       const stakingStatus = await this.getApi().stakingAccountStatus(stakingAccount)
 
@@ -396,7 +398,9 @@ export default abstract class AccountsCommandBase extends ApiCommandBase {
       const missingStakingAccountBalance = requiredStakingAccountBalance.sub(balances.availableBalance)
       if (missingStakingAccountBalance.gtn(0)) {
         this.warn(
-          `Not enough available balance! Missing: ${chalk.cyan(formatBalance(missingStakingAccountBalance))}.` +
+          `Not enough available staking account balance! Missing: ${chalk.cyan(
+            formatBalance(missingStakingAccountBalance)
+          )}.` +
             (additionalStakingAccountCosts.gtn(0)
               ? ` (includes ${formatBalance(additionalStakingAccountCosts)} fee for setting new staking account)`
               : '')

+ 5 - 1
cli/src/base/ApiCommandBase.ts

@@ -453,7 +453,11 @@ export default abstract class ApiCommandBase extends StateAwareCommandBase {
     params: Submittable extends (...args: any[]) => any ? Parameters<Submittable> : [],
     warnOnly = false
   ): Promise<boolean> {
-    this.log(chalk.white(`\nSending ${module}.${method} extrinsic from ${account.address}...`))
+    this.log(
+      chalk.white(
+        `\nSending ${module}.${method} extrinsic from ${account.meta.name ? account.meta.name : account.address}...`
+      )
+    )
     console.log('Params:', this.humanize(params))
     const tx = await this.getUnaugmentedApi().tx[module][method](...params)
     return await this.sendAndFollowTx(account, tx, warnOnly)

+ 4 - 5
cli/src/base/WorkingGroupsCommandBase.ts

@@ -115,12 +115,11 @@ export default abstract class WorkingGroupsCommandBase extends RolesCommandBase
 
   async getApplicationForLeadAction(id: number): Promise<ApplicationDetails> {
     const application = await this.getApi().groupApplication(this.group, id)
-    // TODO: Add once opening-application connection is established
-    // const opening = await this.getApi().groupOpening(this.group, application.wgOpeningId)
+    const opening = await this.getApi().groupOpening(this.group, application.openingId)
 
-    // if (!opening.type.isOfType('Worker')) {
-    //   this.error('A lead can only manage Worker opening applications!', { exit: ExitCodes.AccessDenied })
-    // }
+    if (!opening.type.isOfType('Regular')) {
+      this.error('A lead can only manage Regular opening applications!', { exit: ExitCodes.AccessDenied })
+    }
 
     return application
   }

+ 2 - 1
cli/src/commands/working-groups/application.ts

@@ -27,8 +27,9 @@ export default class WorkingGroupsApplication extends WorkingGroupsCommandBase {
       'Member handle': application.member?.handle_hash.toString() || chalk.red('NONE'),
       'Role account': application.roleAccout.toString(),
       'Reward account': application.rewardAccount.toString(),
-      'Staking account': application.stakingAccount?.toString() || 'NONE',
+      'Staking account': application.stakingAccount.toString(),
       'Description': application.descriptionHash.toString(),
+      'Opening ID': application.openingId.toString(),
     }
     displayCollapsedRow(applicationRow)
   }

+ 4 - 6
cli/src/commands/working-groups/createOpening.ts

@@ -83,12 +83,10 @@ export default class WorkingGroupsCreateOpening extends WorkingGroupsCommandBase
     return [
       JSON.stringify(hrtJson),
       'Regular',
-      openingParamsJson.stakingPolicy
-        ? {
-            stake_amount: openingParamsJson.stakingPolicy.amount,
-            leaving_unstaking_period: openingParamsJson.stakingPolicy.unstakingPeriod,
-          }
-        : null,
+      {
+        stake_amount: openingParamsJson.stakingPolicy.amount,
+        leaving_unstaking_period: openingParamsJson.stakingPolicy.unstakingPeriod,
+      },
       // TODO: Proper bigint handling?
       openingParamsJson.rewardPerBlock?.toString() || null,
     ]

+ 0 - 4
cli/src/commands/working-groups/increaseStake.ts

@@ -31,10 +31,6 @@ export default class WorkingGroupsIncreaseStake extends WorkingGroupsCommandBase
       this.error('Invalid stake amount!', { exit: ExitCodes.InvalidInput })
     }
 
-    if (!worker.stake) {
-      this.error('Cannot increase stake. No associated role stake profile found!', { exit: ExitCodes.InvalidInput })
-    }
-
     await this.sendAndFollowNamedTx(
       await this.getDecodedPair(worker.roleAccount.toString()),
       apiModuleByGroup[this.group],

+ 1 - 1
cli/src/commands/working-groups/updateRewardAccount.ts

@@ -24,7 +24,7 @@ export default class WorkingGroupsUpdateRewardAccount extends WorkingGroupsComma
     // Worker-only gate
     const worker = await this.getRequiredWorkerContext()
 
-    if (!worker.reward) {
+    if (!worker.reward.valuePerBlock) {
       this.error('There is no reward relationship associated with this role!', { exit: ExitCodes.InvalidInput })
     }
 

+ 2 - 2
cli/src/json-schemas/WorkingGroupOpening.schema.json

@@ -5,7 +5,7 @@
   "description": "JSON schema to describe Joystream working group opening",
   "type": "object",
   "additionalProperties": false,
-  "required": ["activateAt", "maxReviewPeriodLength"],
+  "required": ["activateAt", "maxReviewPeriodLength", "stakingPolicy"],
   "properties": {
     "stakingPolicy": { "$ref": "#/definitions/StakingPolicy", "description": "Staking policy" },
     "rewardPerBlock": {
@@ -23,7 +23,7 @@
         "amount": {
           "type": "integer",
           "description": "Stake amount",
-          "minimum": 1
+          "minimum": 2000
         },
         "unstakingPeriod": {
           "type": "integer",

+ 1 - 1
cli/src/json-schemas/typings/WorkingGroupOpening.schema.d.ts

@@ -12,7 +12,7 @@ export interface WorkingGroupOpening {
   /**
    * Staking policy
    */
-  stakingPolicy?: {
+  stakingPolicy: {
     /**
      * Stake amount
      */

File diff suppressed because it is too large
+ 4 - 3
types/augment-codec/all.ts


+ 32 - 36
types/augment-codec/augment-api-query.ts

@@ -4,7 +4,7 @@
 import { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
 import { Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u32, u64 } from '@polkadot/types/primitive';
-import { Application, ApplicationId, Candidate, CastVoteOf, Category, CategoryId, ClassId, ClassOf, ConstitutionInfo, ContentId, CouncilMemberOf, CouncilStageUpdate, CuratorGroup, CuratorGroupId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, EntityController, EntityCreationVoucher, EntityId, EntityOf, MemberId, Membership, MemoText, ModeratorId, Opening, OpeningId, Post, PostId, PropertyId, ProposalId, ProposalOf, ReferendumStage, ServiceProviderRecord, StakingAccountMemberBinding, StorageProviderId, Thread, ThreadId, Url, VoteKind, Worker, WorkerId } from './all';
+import { Application, ApplicationId, Candidate, CastVoteOf, Category, CategoryId, ClassId, ClassOf, ConstitutionInfo, ContentId, CouncilMemberOf, CouncilStageUpdate, CuratorGroup, CuratorGroupId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, EntityController, EntityCreationVoucher, EntityId, EntityOf, MemberId, Membership, MemoText, ModeratorId, Opening, OpeningId, Post, PostId, PropertyId, ProposalId, ProposalOf, ReferendumStage, Reply, ReplyId, ServiceProviderRecord, StakingAccountMemberBinding, StorageProviderId, ThreadId, ThreadOf, Url, VoteKind, Worker, WorkerId } from './all';
 import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
 import { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
 import { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
@@ -60,7 +60,7 @@ declare module '@polkadot/api/types/storage' {
       initialized: AugmentedQuery<ApiType, () => Observable<Option<MaybeRandomness>>>;
       /**
        * How late the current block is compared to its parent.
-       *
+       * 
        * This entry is populated as part of block execution and is cleaned up
        * on block finalization. Querying this storage entry outside of block
        * execution context should always yield zero.
@@ -76,9 +76,9 @@ declare module '@polkadot/api/types/storage' {
       nextRandomness: AugmentedQuery<ApiType, () => Observable<Randomness>>;
       /**
        * The epoch randomness for the *current* epoch.
-       *
+       * 
        * # Security
-       *
+       * 
        * This MUST NOT be used for gambling, as it can be influenced by a
        * malicious validator in the short term. It MAY be used in many
        * cryptographic protocols, however, so long as one remembers that this
@@ -89,11 +89,11 @@ declare module '@polkadot/api/types/storage' {
       randomness: AugmentedQuery<ApiType, () => Observable<Randomness>>;
       /**
        * Randomness under construction.
-       *
+       * 
        * We make a tradeoff between storage accesses and list length.
        * We store the under-construction randomness in segments of up to
        * `UNDER_CONSTRUCTION_SEGMENT_LENGTH`.
-       *
+       * 
        * Once a segment reaches this length, we begin the next one.
        * We reset all segments and return to `0` at the beginning of every
        * epoch.
@@ -107,7 +107,7 @@ declare module '@polkadot/api/types/storage' {
     balances: {
       /**
        * The balance of an account.
-       *
+       * 
        * NOTE: This is only used in the case that this module is used to store balances.
        **/
       account: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<AccountData>>;
@@ -118,7 +118,7 @@ declare module '@polkadot/api/types/storage' {
       locks: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Vec<BalanceLock>>>;
       /**
        * Storage version of the pallet.
-       *
+       * 
        * This is set to v2.0.0 for new networks.
        **/
       storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
@@ -140,7 +140,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Reply by unique blog, post and reply identificators
        **/
-      replyById: AugmentedQueryDoubleMap<ApiType, (key1: PostId | AnyNumber | Uint8Array, key2: ReplyId | null) => Observable<Reply>>;
+      replyById: AugmentedQueryDoubleMap<ApiType, (key1: PostId | AnyNumber | Uint8Array, key2: ReplyId | AnyNumber | Uint8Array) => Observable<Reply>>;
     };
     constitution: {
       constitution: AugmentedQuery<ApiType, () => Observable<ConstitutionInfo>>;
@@ -336,14 +336,10 @@ declare module '@polkadot/api/types/storage' {
        * Thread identifier value to be used for next Thread in threadById.
        **/
       nextThreadId: AugmentedQuery<ApiType, () => Observable<ThreadId>>;
-      /**
-       * Map post identifier to corresponding post.
-       **/
-      postById: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: PostId | AnyNumber | Uint8Array) => Observable<Post>>;
       /**
        * Map thread identifier to corresponding thread.
        **/
-      threadById: AugmentedQueryDoubleMap<ApiType, (key1: CategoryId | AnyNumber | Uint8Array, key2: ThreadId | AnyNumber | Uint8Array) => Observable<Thread>>;
+      threadById: AugmentedQueryDoubleMap<ApiType, (key1: CategoryId | AnyNumber | Uint8Array, key2: ThreadId | AnyNumber | Uint8Array) => Observable<ThreadOf>>;
     };
     forumWorkingGroup: {
       /**
@@ -404,7 +400,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * A mapping from grandpa set ID to the index of the *most recent* session for which its
        * members were responsible.
-       *
+       * 
        * TWOX-NOTE: `SetId` is not under user control.
        **/
       setIdSession: AugmentedQuery<ApiType, (arg: SetId | AnyNumber | Uint8Array) => Observable<Option<SessionIndex>>>;
@@ -425,7 +421,7 @@ declare module '@polkadot/api/types/storage' {
       authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>>;
       /**
        * The block number after which it's ok to send heartbeats in current session.
-       *
+       * 
        * At the beginning of each session we set this to a value that should
        * fall roughly in the middle of the session duration.
        * The idea is to first wait for the validators to produce a block
@@ -539,9 +535,9 @@ declare module '@polkadot/api/types/storage' {
       reports: AugmentedQuery<ApiType, (arg: ReportIdOf | string | Uint8Array) => Observable<Option<OffenceDetails>>>;
       /**
        * Enumerates all reports of a kind along with the time they happened.
-       *
+       * 
        * All reports are sorted by the time of offence.
-       *
+       * 
        * Note that the actual type of this mapping is `Vec<u8>`, this is because values of
        * different types are not supported at the moment so we are doing the manual serialization.
        **/
@@ -623,7 +619,7 @@ declare module '@polkadot/api/types/storage' {
       currentIndex: AugmentedQuery<ApiType, () => Observable<SessionIndex>>;
       /**
        * Indices of disabled validators.
-       *
+       * 
        * The set is cleared when `on_session_ending` returns a new set of identities.
        **/
       disabledValidators: AugmentedQuery<ApiType, () => Observable<Vec<u32>>>;
@@ -653,7 +649,7 @@ declare module '@polkadot/api/types/storage' {
     staking: {
       /**
        * The active era information, it holds index and start.
-       *
+       * 
        * The active era is the era currently rewarded.
        * Validator set of this era must be equal to `SessionInterface::validators`.
        **/
@@ -664,7 +660,7 @@ declare module '@polkadot/api/types/storage' {
       bonded: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<AccountId>>>;
       /**
        * A mapping from still-bonded eras to the first session index of that era.
-       *
+       * 
        * Must contains information for eras for the range:
        * `[active_era - bounding_duration; active_era]`
        **/
@@ -676,7 +672,7 @@ declare module '@polkadot/api/types/storage' {
       canceledSlashPayout: AugmentedQuery<ApiType, () => Observable<BalanceOf>>;
       /**
        * The current era index.
-       *
+       * 
        * This is the latest planned era, depending on how the Session pallet queues the validator
        * set, it might be active or not.
        **/
@@ -697,23 +693,23 @@ declare module '@polkadot/api/types/storage' {
       erasRewardPoints: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<EraRewardPoints>>;
       /**
        * Exposure of validator at era.
-       *
+       * 
        * This is keyed first by the era index to allow bulk deletion and then the stash account.
-       *
+       * 
        * Is it removed after `HISTORY_DEPTH` eras.
        * If stakers hasn't been set or has been removed then empty exposure is returned.
        **/
       erasStakers: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Exposure>>;
       /**
        * Clipped Exposure of validator at era.
-       *
+       * 
        * This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the
        * `T::MaxNominatorRewardedPerValidator` biggest stakers.
        * (Note: the field `total` and `own` of the exposure remains unchanged).
        * This is used to limit the i/o cost for the nominator payout.
-       *
+       * 
        * This is keyed fist by the era index to allow bulk deletion and then the stash account.
-       *
+       * 
        * Is it removed after `HISTORY_DEPTH` eras.
        * If stakers hasn't been set or has been removed then empty exposure is returned.
        **/
@@ -729,15 +725,15 @@ declare module '@polkadot/api/types/storage' {
       erasTotalStake: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<BalanceOf>>;
       /**
        * Similar to `ErasStakers`, this holds the preferences of validators.
-       *
+       * 
        * This is keyed first by the era index to allow bulk deletion and then the stash account.
-       *
+       * 
        * Is it removed after `HISTORY_DEPTH` eras.
        **/
       erasValidatorPrefs: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>>;
       /**
        * The total validator era payout for the last `HISTORY_DEPTH` eras.
-       *
+       * 
        * Eras that haven't finished yet or has been removed doesn't have reward.
        **/
       erasValidatorReward: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<Option<BalanceOf>>>;
@@ -747,9 +743,9 @@ declare module '@polkadot/api/types/storage' {
       forceEra: AugmentedQuery<ApiType, () => Observable<Forcing>>;
       /**
        * Number of eras to keep in history.
-       *
+       * 
        * Information is kept for eras in `[current_era - history_depth; current_era]`.
-       *
+       * 
        * Must be more than the number of eras delayed by session otherwise. I.e. active era must
        * always be in history. I.e. `active_era > current_era - history_depth` must be
        * guaranteed.
@@ -802,7 +798,7 @@ declare module '@polkadot/api/types/storage' {
       slashingSpans: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<SlashingSpans>>>;
       /**
        * The percentage of the slash that is distributed to reporters.
-       *
+       * 
        * The rest of the slashed value is handled by the `Slash`.
        **/
       slashRewardFraction: AugmentedQuery<ApiType, () => Observable<Perbill>>;
@@ -824,7 +820,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * True if network has been upgraded to this version.
        * Storage version of the pallet.
-       *
+       * 
        * This is set to v3.0.0 for new networks.
        **/
       storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
@@ -926,11 +922,11 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Mapping between a topic (represented by T::Hash) and a vector of indexes
        * of events in the `<Events<T>>` list.
-       *
+       * 
        * All topic vectors have deterministic storage locations depending on the topic. This
        * allows light-clients to leverage the changes trie storage tracking mechanism and
        * in case of changes fetch the list of events of interest.
-       *
+       * 
        * The value has the type `(T::BlockNumber, EventIndex)` because if we used only just
        * the `EventIndex` then in case if the topic has the same contents on the next block
        * no notification will be triggered thus the event might be lost.

+ 10 - 10
types/augment-codec/augment-api-tx.ts

@@ -4,7 +4,7 @@
 import { AnyNumber } from '@polkadot/types/types';
 import { BTreeMap, BTreeSet, Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64 } from '@polkadot/types/primitive';
-import { Actor, ActorId, ApplicationId, ApplyOnOpeningParameters, BuyMembershipParameters, CategoryId, ClassId, ClassPermissions, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, EntityController, EntityId, ForumUserId, GeneralProposalParameters, InputPropertyValue, InputValue, InviteMembershipParameters, MemberId, MemoText, ModeratorId, Nonce, OpeningId, OpeningType, OperationType, Poll, PostId, PostReactionId, PrivilegedActor, Property, PropertyId, ProposalDetailsOf, ProposalId, SchemaId, StakePolicy, StorageProviderId, ThreadId, ThreadMode, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
+import { Actor, ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BuyMembershipParameters, CategoryId, ClassId, ClassPermissions, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, EntityController, EntityId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InputPropertyValue, InputValue, InviteMembershipParameters, MemberId, MemoText, ModeratorId, Nonce, OpeningId, OpeningType, OperationType, ParticipantId, Poll, PostId, PostReactionId, PrivilegedActor, Property, PropertyId, ProposalDetailsOf, ProposalId, ReplyId, SchemaId, StakePolicy, StorageProviderId, ThreadId, ThreadMode, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
 import { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
 import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
@@ -146,7 +146,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      createReply: AugmentedSubmittable<(participantId: ParticipantId | null, postId: PostId | AnyNumber | Uint8Array, replyId: Option<ReplyId> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createReply: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, replyId: Option<ReplyId> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Blog owner can edit post, related to a given blog (if unlocked)
        * with a new title and/or body
@@ -174,7 +174,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      editReply: AugmentedSubmittable<(participantId: ParticipantId | null, postId: PostId | AnyNumber | Uint8Array, replyId: ReplyId | null, newText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      editReply: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, replyId: ReplyId | AnyNumber | Uint8Array, newText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Blog owner can lock posts, related to a given blog,
        * making post immutable to any actions (replies creation, post editing, etc.)
@@ -322,7 +322,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: Option<StakePolicy> | null | object | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: StakePolicy | { stake_amount?: any; leaving_unstaking_period?: any } | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Apply on a worker opening.
        * 
@@ -544,7 +544,7 @@ declare module '@polkadot/api/types/submittable' {
        * - `O(1)` doesn't depend on the state or parameters
        * # </weight>
        **/
-      fundingRequest: AugmentedSubmittable<(fundingRequests: Vec<FundingRequestParameters> | (FundingRequestParameters | null)[]) => SubmittableExtrinsic<ApiType>>;
+      fundingRequest: AugmentedSubmittable<(fundingRequests: Vec<FundingRequestParameters> | (FundingRequestParameters | { account?: any; amount?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
       /**
        * Plan the next budget refill.
        * 
@@ -960,7 +960,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: Option<StakePolicy> | null | object | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: StakePolicy | { stake_amount?: any; leaving_unstaking_period?: any } | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Apply on a worker opening.
        * 
@@ -1249,7 +1249,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      updateWorkingGroupBudget: AugmentedSubmittable<(workingGroup: WorkingGroup | 'Forum'|'Storage'|'Content'|'Membership' | number | Uint8Array, amount: BalanceOf | AnyNumber | Uint8Array, balanceKind: BalanceKind | null) => SubmittableExtrinsic<ApiType>>;
+      updateWorkingGroupBudget: AugmentedSubmittable<(workingGroup: WorkingGroup | 'Forum'|'Storage'|'Content'|'Membership' | number | Uint8Array, amount: BalanceOf | AnyNumber | Uint8Array, balanceKind: BalanceKind | 'Positive'|'Negative' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
     members: {
       /**
@@ -1448,7 +1448,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: Option<StakePolicy> | null | object | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: StakePolicy | { stake_amount?: any; leaving_unstaking_period?: any } | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Apply on a worker opening.
        * 
@@ -1663,7 +1663,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      createProposal: AugmentedSubmittable<(generalProposalParameters: GeneralProposalParameters | { member_id?: any; title?: any; description?: any; staking_account_id?: any; exact_execution_block?: any } | string | Uint8Array, proposalDetails: ProposalDetailsOf | { Text: any } | { RuntimeUpgrade: any } | { Spending: any } | { SetValidatorCount: any } | { AddWorkingGroupLeaderOpening: any } | { FillWorkingGroupLeaderOpening: any } | { SetWorkingGroupBudgetCapacity: any } | { DecreaseWorkingGroupLeaderStake: any } | { SlashWorkingGroupLeaderStake: any } | { SetWorkingGroupLeaderReward: any } | { TerminateWorkingGroupLeaderRole: any } | { AmendConstitution: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createProposal: AugmentedSubmittable<(generalProposalParameters: GeneralProposalParameters | { member_id?: any; title?: any; description?: any; staking_account_id?: any; exact_execution_block?: any } | string | Uint8Array, proposalDetails: ProposalDetailsOf | { Signal: any } | { RuntimeUpgrade: any } | { FundingRequest: any } | { SetMaxValidatorCount: any } | { CreateWorkingGroupLeadOpening: any } | { FillWorkingGroupLeadOpening: any } | { UpdateWorkingGroupBudget: any } | { DecreaseWorkingGroupLeadStake: any } | { SlashWorkingGroupLead: any } | { SetWorkingGroupLeadReward: any } | { TerminateWorkingGroupLead: any } | { AmendConstitution: any } | { CancelWorkingGroupLeadOpening: any } | { SetMembershipPrice: any } | { SetCouncilBudgetIncrement: any } | { SetCouncilorReward: any } | { SetInitialInvitationBalance: any } | { SetInitialInvitationCount: any } | { SetMembershipLeadInvitationQuota: any } | { SetReferralCut: any } | { CreateBlogPost: any } | { EditBlogPost: any } | { LockBlogPost: any } | { UnlockBlogPost: any } | { VetoProposal: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
     proposalsDiscussion: {
       /**
@@ -2313,7 +2313,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: Option<StakePolicy> | null | object | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: StakePolicy | { stake_amount?: any; leaving_unstaking_period?: any } | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Apply on a worker opening.
        * 

File diff suppressed because it is too large
+ 0 - 0
types/augment-codec/augment-types.ts


+ 85 - 30
types/augment/all/defs.json

@@ -20,6 +20,12 @@
         ]
     },
     "MemoText": "Text",
+    "BalanceKind": {
+        "_enum": [
+            "Positive",
+            "Negative"
+        ]
+    },
     "Address": "AccountId",
     "LookupSource": "AccountId",
     "Membership": {
@@ -132,13 +138,22 @@
             "Moderator": "ModeratorId"
         }
     },
+    "ThreadOf": {
+        "title_hash": "Hash",
+        "category_id": "CategoryId",
+        "author_id": "ForumUserId",
+        "archived": "bool",
+        "poll": "Option<Poll>",
+        "num_direct_posts": "u32"
+    },
     "ApplicationId": "u64",
     "Application": {
         "role_account_id": "AccountId",
         "reward_account_id": "AccountId",
-        "staking_account_id": "Option<AccountId>",
+        "staking_account_id": "AccountId",
         "member_id": "MemberId",
-        "description_hash": "Text"
+        "description_hash": "Bytes",
+        "opening_id": "OpeningId"
     },
     "ApplicationInfo": {
         "application_id": "ApplicationId",
@@ -150,7 +165,7 @@
     "Worker": {
         "member_id": "MemberId",
         "role_account_id": "AccountId",
-        "staking_account_id": "Option<AccountId>",
+        "staking_account_id": "AccountId",
         "reward_account_id": "AccountId",
         "started_leaving_at": "Option<u32>",
         "job_unstaking_period": "u32",
@@ -166,7 +181,7 @@
         "opening_type": "OpeningType",
         "created": "u32",
         "description_hash": "Bytes",
-        "stake_policy": "Option<StakePolicy>",
+        "stake_policy": "StakePolicy",
         "reward_per_block": "Option<u128>"
     },
     "OpeningId": "u64",
@@ -191,7 +206,7 @@
         "role_account_id": "AccountId",
         "reward_account_id": "AccountId",
         "description": "Text",
-        "stake_parameters": "Option<StakeParameters>"
+        "stake_parameters": "StakeParameters"
     },
     "Penalty": {
         "slashing_text": "Text",
@@ -232,6 +247,16 @@
         "active": "bool"
     },
     "DataObjectsMap": "BTreeMap<ContentId,DataObject>",
+    "ParticipantId": "u64",
+    "Title": "Text",
+    "UpdatedTitle": "Option<Text>",
+    "UpdatedBody": "Option<Text>",
+    "ReplyId": "u64",
+    "Reply": {
+        "text_hash": "Hash",
+        "owner": "ParticipantId",
+        "parent_id": "PostId"
+    },
     "ProposalId": "u32",
     "ProposalStatus": {
         "_enum": {
@@ -252,34 +277,60 @@
     },
     "ProposalDetails": {
         "_enum": {
-            "Text": "Text",
+            "Signal": "Text",
             "RuntimeUpgrade": "Bytes",
-            "Spending": "(Balance,AccountId)",
-            "SetValidatorCount": "u32",
-            "AddWorkingGroupLeaderOpening": "AddOpeningParameters",
-            "FillWorkingGroupLeaderOpening": "FillOpeningParameters",
-            "SetWorkingGroupBudgetCapacity": "(Balance,WorkingGroup)",
-            "DecreaseWorkingGroupLeaderStake": "(WorkerId,Balance,WorkingGroup)",
-            "SlashWorkingGroupLeaderStake": "(WorkerId,Balance,WorkingGroup)",
-            "SetWorkingGroupLeaderReward": "(WorkerId,Balance,WorkingGroup)",
-            "TerminateWorkingGroupLeaderRole": "TerminateRoleParameters",
-            "AmendConstitution": "Text"
+            "FundingRequest": "Vec<FundingRequestParameters>",
+            "SetMaxValidatorCount": "u32",
+            "CreateWorkingGroupLeadOpening": "CreateOpeningParameters",
+            "FillWorkingGroupLeadOpening": "FillOpeningParameters",
+            "UpdateWorkingGroupBudget": "(Balance,WorkingGroup,BalanceKind)",
+            "DecreaseWorkingGroupLeadStake": "(WorkerId,Balance,WorkingGroup)",
+            "SlashWorkingGroupLead": "(WorkerId,Balance,WorkingGroup)",
+            "SetWorkingGroupLeadReward": "(WorkerId,Option<Balance>,WorkingGroup)",
+            "TerminateWorkingGroupLead": "TerminateRoleParameters",
+            "AmendConstitution": "Text",
+            "CancelWorkingGroupLeadOpening": "(OpeningId,WorkingGroup)",
+            "SetMembershipPrice": "u128",
+            "SetCouncilBudgetIncrement": "u128",
+            "SetCouncilorReward": "u128",
+            "SetInitialInvitationBalance": "u128",
+            "SetInitialInvitationCount": "u32",
+            "SetMembershipLeadInvitationQuota": "u32",
+            "SetReferralCut": "u128",
+            "CreateBlogPost": "(Text,Text)",
+            "EditBlogPost": "(PostId,Option<Text>,Option<Text>)",
+            "LockBlogPost": "PostId",
+            "UnlockBlogPost": "PostId",
+            "VetoProposal": "ProposalId"
         }
     },
     "ProposalDetailsOf": {
         "_enum": {
-            "Text": "Text",
+            "Signal": "Text",
             "RuntimeUpgrade": "Bytes",
-            "Spending": "(Balance,AccountId)",
-            "SetValidatorCount": "u32",
-            "AddWorkingGroupLeaderOpening": "AddOpeningParameters",
-            "FillWorkingGroupLeaderOpening": "FillOpeningParameters",
-            "SetWorkingGroupBudgetCapacity": "(Balance,WorkingGroup)",
-            "DecreaseWorkingGroupLeaderStake": "(WorkerId,Balance,WorkingGroup)",
-            "SlashWorkingGroupLeaderStake": "(WorkerId,Balance,WorkingGroup)",
-            "SetWorkingGroupLeaderReward": "(WorkerId,Balance,WorkingGroup)",
-            "TerminateWorkingGroupLeaderRole": "TerminateRoleParameters",
-            "AmendConstitution": "Text"
+            "FundingRequest": "Vec<FundingRequestParameters>",
+            "SetMaxValidatorCount": "u32",
+            "CreateWorkingGroupLeadOpening": "CreateOpeningParameters",
+            "FillWorkingGroupLeadOpening": "FillOpeningParameters",
+            "UpdateWorkingGroupBudget": "(Balance,WorkingGroup,BalanceKind)",
+            "DecreaseWorkingGroupLeadStake": "(WorkerId,Balance,WorkingGroup)",
+            "SlashWorkingGroupLead": "(WorkerId,Balance,WorkingGroup)",
+            "SetWorkingGroupLeadReward": "(WorkerId,Option<Balance>,WorkingGroup)",
+            "TerminateWorkingGroupLead": "TerminateRoleParameters",
+            "AmendConstitution": "Text",
+            "CancelWorkingGroupLeadOpening": "(OpeningId,WorkingGroup)",
+            "SetMembershipPrice": "u128",
+            "SetCouncilBudgetIncrement": "u128",
+            "SetCouncilorReward": "u128",
+            "SetInitialInvitationBalance": "u128",
+            "SetInitialInvitationCount": "u32",
+            "SetMembershipLeadInvitationQuota": "u32",
+            "SetReferralCut": "u128",
+            "CreateBlogPost": "(Text,Text)",
+            "EditBlogPost": "(PostId,Option<Text>,Option<Text>)",
+            "LockBlogPost": "PostId",
+            "UnlockBlogPost": "PostId",
+            "VetoProposal": "ProposalId"
         }
     },
     "VotingResults": {
@@ -321,9 +372,9 @@
     "DiscussionPost": {
         "author_id": "u64"
     },
-    "AddOpeningParameters": {
+    "CreateOpeningParameters": {
         "description": "Text",
-        "stake_policy": "Option<StakePolicy>",
+        "stake_policy": "StakePolicy",
         "reward_per_block": "Option<u128>",
         "working_group": "WorkingGroup"
     },
@@ -334,7 +385,7 @@
     },
     "TerminateRoleParameters": {
         "worker_id": "WorkerId",
-        "penalty": "Option<Penalty>",
+        "slashing_amount": "Option<u128>",
         "working_group": "WorkingGroup"
     },
     "ProposalDecision": {
@@ -369,6 +420,10 @@
             "ExecutionFailed": "ExecutionFailed"
         }
     },
+    "FundingRequestParameters": {
+        "account": "AccountId",
+        "amount": "u128"
+    },
     "Nonce": "u64",
     "EntityId": "u64",
     "ClassId": "u64",

+ 151 - 54
types/augment/all/types.ts

@@ -18,14 +18,6 @@ export interface Actor extends Enum {
 /** @name ActorId */
 export interface ActorId extends u64 {}
 
-/** @name AddOpeningParameters */
-export interface AddOpeningParameters extends Struct {
-  readonly description: Text;
-  readonly stake_policy: Option<StakePolicy>;
-  readonly reward_per_block: Option<u128>;
-  readonly working_group: WorkingGroup;
-}
-
 /** @name Address */
 export interface Address extends AccountId {}
 
@@ -40,9 +32,10 @@ export interface AddSchemaSupportToEntityOperation extends Struct {
 export interface Application extends Struct {
   readonly role_account_id: AccountId;
   readonly reward_account_id: AccountId;
-  readonly staking_account_id: Option<AccountId>;
+  readonly staking_account_id: AccountId;
   readonly member_id: MemberId;
-  readonly description_hash: Text;
+  readonly description_hash: Bytes;
+  readonly opening_id: OpeningId;
 }
 
 /** @name ApplicationId */
@@ -67,7 +60,7 @@ export interface ApplyOnOpeningParameters extends Struct {
   readonly role_account_id: AccountId;
   readonly reward_account_id: AccountId;
   readonly description: Text;
-  readonly stake_parameters: Option<StakeParameters>;
+  readonly stake_parameters: StakeParameters;
 }
 
 /** @name Approved */
@@ -76,6 +69,12 @@ export interface Approved extends Enum {
   readonly isPendingConstitutionality: boolean;
 }
 
+/** @name BalanceKind */
+export interface BalanceKind extends Enum {
+  readonly isPositive: boolean;
+  readonly isNegative: boolean;
+}
+
 /** @name BlockAndTime */
 export interface BlockAndTime extends Struct {
   readonly block: u32;
@@ -210,6 +209,14 @@ export interface CreateEntityOperation extends Struct {
   readonly class_id: ClassId;
 }
 
+/** @name CreateOpeningParameters */
+export interface CreateOpeningParameters extends Struct {
+  readonly description: Text;
+  readonly stake_policy: StakePolicy;
+  readonly reward_per_block: Option<u128>;
+  readonly working_group: WorkingGroup;
+}
+
 /** @name CuratorGroup */
 export interface CuratorGroup extends Struct {
   readonly curators: Vec<CuratorId>;
@@ -338,6 +345,12 @@ export interface FillOpeningParameters extends Struct {
 /** @name ForumUserId */
 export interface ForumUserId extends u64 {}
 
+/** @name FundingRequestParameters */
+export interface FundingRequestParameters extends Struct {
+  readonly account: AccountId;
+  readonly amount: u128;
+}
+
 /** @name GeneralProposalParameters */
 export interface GeneralProposalParameters extends Struct {
   readonly member_id: MemberId;
@@ -447,7 +460,7 @@ export interface Opening extends Struct {
   readonly opening_type: OpeningType;
   readonly created: u32;
   readonly description_hash: Bytes;
-  readonly stake_policy: Option<StakePolicy>;
+  readonly stake_policy: StakePolicy;
   readonly reward_per_block: Option<u128>;
 }
 
@@ -500,6 +513,9 @@ export interface ParametrizedPropertyValue extends Enum {
   readonly asInternalEntityVec: Vec<ParameterizedEntity>;
 }
 
+/** @name ParticipantId */
+export interface ParticipantId extends u64 {}
+
 /** @name Penalty */
 export interface Penalty extends Struct {
   readonly slashing_text: Text;
@@ -602,58 +618,110 @@ export interface ProposalDecision extends Enum {
 
 /** @name ProposalDetails */
 export interface ProposalDetails extends Enum {
-  readonly isText: boolean;
-  readonly asText: Text;
+  readonly isSignal: boolean;
+  readonly asSignal: Text;
   readonly isRuntimeUpgrade: boolean;
   readonly asRuntimeUpgrade: Bytes;
-  readonly isSpending: boolean;
-  readonly asSpending: ITuple<[Balance, AccountId]>;
-  readonly isSetValidatorCount: boolean;
-  readonly asSetValidatorCount: u32;
-  readonly isAddWorkingGroupLeaderOpening: boolean;
-  readonly asAddWorkingGroupLeaderOpening: AddOpeningParameters;
-  readonly isFillWorkingGroupLeaderOpening: boolean;
-  readonly asFillWorkingGroupLeaderOpening: FillOpeningParameters;
-  readonly isSetWorkingGroupBudgetCapacity: boolean;
-  readonly asSetWorkingGroupBudgetCapacity: ITuple<[Balance, WorkingGroup]>;
-  readonly isDecreaseWorkingGroupLeaderStake: boolean;
-  readonly asDecreaseWorkingGroupLeaderStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
-  readonly isSlashWorkingGroupLeaderStake: boolean;
-  readonly asSlashWorkingGroupLeaderStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
-  readonly isSetWorkingGroupLeaderReward: boolean;
-  readonly asSetWorkingGroupLeaderReward: ITuple<[WorkerId, Balance, WorkingGroup]>;
-  readonly isTerminateWorkingGroupLeaderRole: boolean;
-  readonly asTerminateWorkingGroupLeaderRole: TerminateRoleParameters;
+  readonly isFundingRequest: boolean;
+  readonly asFundingRequest: Vec<FundingRequestParameters>;
+  readonly isSetMaxValidatorCount: boolean;
+  readonly asSetMaxValidatorCount: u32;
+  readonly isCreateWorkingGroupLeadOpening: boolean;
+  readonly asCreateWorkingGroupLeadOpening: CreateOpeningParameters;
+  readonly isFillWorkingGroupLeadOpening: boolean;
+  readonly asFillWorkingGroupLeadOpening: FillOpeningParameters;
+  readonly isUpdateWorkingGroupBudget: boolean;
+  readonly asUpdateWorkingGroupBudget: ITuple<[Balance, WorkingGroup, BalanceKind]>;
+  readonly isDecreaseWorkingGroupLeadStake: boolean;
+  readonly asDecreaseWorkingGroupLeadStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isSlashWorkingGroupLead: boolean;
+  readonly asSlashWorkingGroupLead: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isSetWorkingGroupLeadReward: boolean;
+  readonly asSetWorkingGroupLeadReward: ITuple<[WorkerId, Option<Balance>, WorkingGroup]>;
+  readonly isTerminateWorkingGroupLead: boolean;
+  readonly asTerminateWorkingGroupLead: TerminateRoleParameters;
   readonly isAmendConstitution: boolean;
   readonly asAmendConstitution: Text;
+  readonly isCancelWorkingGroupLeadOpening: boolean;
+  readonly asCancelWorkingGroupLeadOpening: ITuple<[OpeningId, WorkingGroup]>;
+  readonly isSetMembershipPrice: boolean;
+  readonly asSetMembershipPrice: u128;
+  readonly isSetCouncilBudgetIncrement: boolean;
+  readonly asSetCouncilBudgetIncrement: u128;
+  readonly isSetCouncilorReward: boolean;
+  readonly asSetCouncilorReward: u128;
+  readonly isSetInitialInvitationBalance: boolean;
+  readonly asSetInitialInvitationBalance: u128;
+  readonly isSetInitialInvitationCount: boolean;
+  readonly asSetInitialInvitationCount: u32;
+  readonly isSetMembershipLeadInvitationQuota: boolean;
+  readonly asSetMembershipLeadInvitationQuota: u32;
+  readonly isSetReferralCut: boolean;
+  readonly asSetReferralCut: u128;
+  readonly isCreateBlogPost: boolean;
+  readonly asCreateBlogPost: ITuple<[Text, Text]>;
+  readonly isEditBlogPost: boolean;
+  readonly asEditBlogPost: ITuple<[PostId, Option<Text>, Option<Text>]>;
+  readonly isLockBlogPost: boolean;
+  readonly asLockBlogPost: PostId;
+  readonly isUnlockBlogPost: boolean;
+  readonly asUnlockBlogPost: PostId;
+  readonly isVetoProposal: boolean;
+  readonly asVetoProposal: ProposalId;
 }
 
 /** @name ProposalDetailsOf */
 export interface ProposalDetailsOf extends Enum {
-  readonly isText: boolean;
-  readonly asText: Text;
+  readonly isSignal: boolean;
+  readonly asSignal: Text;
   readonly isRuntimeUpgrade: boolean;
   readonly asRuntimeUpgrade: Bytes;
-  readonly isSpending: boolean;
-  readonly asSpending: ITuple<[Balance, AccountId]>;
-  readonly isSetValidatorCount: boolean;
-  readonly asSetValidatorCount: u32;
-  readonly isAddWorkingGroupLeaderOpening: boolean;
-  readonly asAddWorkingGroupLeaderOpening: AddOpeningParameters;
-  readonly isFillWorkingGroupLeaderOpening: boolean;
-  readonly asFillWorkingGroupLeaderOpening: FillOpeningParameters;
-  readonly isSetWorkingGroupBudgetCapacity: boolean;
-  readonly asSetWorkingGroupBudgetCapacity: ITuple<[Balance, WorkingGroup]>;
-  readonly isDecreaseWorkingGroupLeaderStake: boolean;
-  readonly asDecreaseWorkingGroupLeaderStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
-  readonly isSlashWorkingGroupLeaderStake: boolean;
-  readonly asSlashWorkingGroupLeaderStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
-  readonly isSetWorkingGroupLeaderReward: boolean;
-  readonly asSetWorkingGroupLeaderReward: ITuple<[WorkerId, Balance, WorkingGroup]>;
-  readonly isTerminateWorkingGroupLeaderRole: boolean;
-  readonly asTerminateWorkingGroupLeaderRole: TerminateRoleParameters;
+  readonly isFundingRequest: boolean;
+  readonly asFundingRequest: Vec<FundingRequestParameters>;
+  readonly isSetMaxValidatorCount: boolean;
+  readonly asSetMaxValidatorCount: u32;
+  readonly isCreateWorkingGroupLeadOpening: boolean;
+  readonly asCreateWorkingGroupLeadOpening: CreateOpeningParameters;
+  readonly isFillWorkingGroupLeadOpening: boolean;
+  readonly asFillWorkingGroupLeadOpening: FillOpeningParameters;
+  readonly isUpdateWorkingGroupBudget: boolean;
+  readonly asUpdateWorkingGroupBudget: ITuple<[Balance, WorkingGroup, BalanceKind]>;
+  readonly isDecreaseWorkingGroupLeadStake: boolean;
+  readonly asDecreaseWorkingGroupLeadStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isSlashWorkingGroupLead: boolean;
+  readonly asSlashWorkingGroupLead: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isSetWorkingGroupLeadReward: boolean;
+  readonly asSetWorkingGroupLeadReward: ITuple<[WorkerId, Option<Balance>, WorkingGroup]>;
+  readonly isTerminateWorkingGroupLead: boolean;
+  readonly asTerminateWorkingGroupLead: TerminateRoleParameters;
   readonly isAmendConstitution: boolean;
   readonly asAmendConstitution: Text;
+  readonly isCancelWorkingGroupLeadOpening: boolean;
+  readonly asCancelWorkingGroupLeadOpening: ITuple<[OpeningId, WorkingGroup]>;
+  readonly isSetMembershipPrice: boolean;
+  readonly asSetMembershipPrice: u128;
+  readonly isSetCouncilBudgetIncrement: boolean;
+  readonly asSetCouncilBudgetIncrement: u128;
+  readonly isSetCouncilorReward: boolean;
+  readonly asSetCouncilorReward: u128;
+  readonly isSetInitialInvitationBalance: boolean;
+  readonly asSetInitialInvitationBalance: u128;
+  readonly isSetInitialInvitationCount: boolean;
+  readonly asSetInitialInvitationCount: u32;
+  readonly isSetMembershipLeadInvitationQuota: boolean;
+  readonly asSetMembershipLeadInvitationQuota: u32;
+  readonly isSetReferralCut: boolean;
+  readonly asSetReferralCut: u128;
+  readonly isCreateBlogPost: boolean;
+  readonly asCreateBlogPost: ITuple<[Text, Text]>;
+  readonly isEditBlogPost: boolean;
+  readonly asEditBlogPost: ITuple<[PostId, Option<Text>, Option<Text>]>;
+  readonly isLockBlogPost: boolean;
+  readonly asLockBlogPost: PostId;
+  readonly isUnlockBlogPost: boolean;
+  readonly asUnlockBlogPost: PostId;
+  readonly isVetoProposal: boolean;
+  readonly asVetoProposal: ProposalId;
 }
 
 /** @name ProposalId */
@@ -718,6 +786,16 @@ export interface ReferendumStageVoting extends Struct {
   readonly current_cycle_id: u64;
 }
 
+/** @name Reply */
+export interface Reply extends Struct {
+  readonly text_hash: Hash;
+  readonly owner: ParticipantId;
+  readonly parent_id: PostId;
+}
+
+/** @name ReplyId */
+export interface ReplyId extends u64 {}
+
 /** @name SameController */
 export interface SameController extends bool {}
 
@@ -804,7 +882,7 @@ export interface StoredValue extends Enum {
 /** @name TerminateRoleParameters */
 export interface TerminateRoleParameters extends Struct {
   readonly worker_id: WorkerId;
-  readonly penalty: Option<Penalty>;
+  readonly slashing_amount: Option<u128>;
   readonly working_group: WorkingGroup;
 }
 
@@ -831,6 +909,25 @@ export interface ThreadMode extends Enum {
   readonly asClosed: Vec<MemberId>;
 }
 
+/** @name ThreadOf */
+export interface ThreadOf extends Struct {
+  readonly title_hash: Hash;
+  readonly category_id: CategoryId;
+  readonly author_id: ForumUserId;
+  readonly archived: bool;
+  readonly poll: Option<Poll>;
+  readonly num_direct_posts: u32;
+}
+
+/** @name Title */
+export interface Title extends Text {}
+
+/** @name UpdatedBody */
+export interface UpdatedBody extends Option<Text> {}
+
+/** @name UpdatedTitle */
+export interface UpdatedTitle extends Option<Text> {}
+
 /** @name UpdatePropertyValuesOperation */
 export interface UpdatePropertyValuesOperation extends Struct {
   readonly entity_id: ParameterizedEntity;
@@ -920,7 +1017,7 @@ export interface VotingResults extends Struct {
 export interface Worker extends Struct {
   readonly member_id: MemberId;
   readonly role_account_id: AccountId;
-  readonly staking_account_id: Option<AccountId>;
+  readonly staking_account_id: AccountId;
   readonly reward_account_id: AccountId;
   readonly started_leaving_at: Option<u32>;
   readonly job_unstaking_period: u32;

+ 3 - 7
types/augment/augment-api-query.ts

@@ -4,7 +4,7 @@
 import { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
 import { Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u32, u64 } from '@polkadot/types/primitive';
-import { Application, ApplicationId, Candidate, CastVoteOf, Category, CategoryId, ClassId, ClassOf, ConstitutionInfo, ContentId, CouncilMemberOf, CouncilStageUpdate, CuratorGroup, CuratorGroupId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, EntityController, EntityCreationVoucher, EntityId, EntityOf, MemberId, Membership, MemoText, ModeratorId, Opening, OpeningId, Post, PostId, PropertyId, ProposalId, ProposalOf, ReferendumStage, ServiceProviderRecord, StakingAccountMemberBinding, StorageProviderId, Thread, ThreadId, Url, VoteKind, Worker, WorkerId } from './all';
+import { Application, ApplicationId, Candidate, CastVoteOf, Category, CategoryId, ClassId, ClassOf, ConstitutionInfo, ContentId, CouncilMemberOf, CouncilStageUpdate, CuratorGroup, CuratorGroupId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, EntityController, EntityCreationVoucher, EntityId, EntityOf, MemberId, Membership, MemoText, ModeratorId, Opening, OpeningId, Post, PostId, PropertyId, ProposalId, ProposalOf, ReferendumStage, Reply, ReplyId, ServiceProviderRecord, StakingAccountMemberBinding, StorageProviderId, ThreadId, ThreadOf, Url, VoteKind, Worker, WorkerId } from './all';
 import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
 import { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
 import { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
@@ -140,7 +140,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Reply by unique blog, post and reply identificators
        **/
-      replyById: AugmentedQueryDoubleMap<ApiType, (key1: PostId | AnyNumber | Uint8Array, key2: ReplyId | null) => Observable<Reply>>;
+      replyById: AugmentedQueryDoubleMap<ApiType, (key1: PostId | AnyNumber | Uint8Array, key2: ReplyId | AnyNumber | Uint8Array) => Observable<Reply>>;
     };
     constitution: {
       constitution: AugmentedQuery<ApiType, () => Observable<ConstitutionInfo>>;
@@ -336,14 +336,10 @@ declare module '@polkadot/api/types/storage' {
        * Thread identifier value to be used for next Thread in threadById.
        **/
       nextThreadId: AugmentedQuery<ApiType, () => Observable<ThreadId>>;
-      /**
-       * Map post identifier to corresponding post.
-       **/
-      postById: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: PostId | AnyNumber | Uint8Array) => Observable<Post>>;
       /**
        * Map thread identifier to corresponding thread.
        **/
-      threadById: AugmentedQueryDoubleMap<ApiType, (key1: CategoryId | AnyNumber | Uint8Array, key2: ThreadId | AnyNumber | Uint8Array) => Observable<Thread>>;
+      threadById: AugmentedQueryDoubleMap<ApiType, (key1: CategoryId | AnyNumber | Uint8Array, key2: ThreadId | AnyNumber | Uint8Array) => Observable<ThreadOf>>;
     };
     forumWorkingGroup: {
       /**

+ 10 - 10
types/augment/augment-api-tx.ts

@@ -4,7 +4,7 @@
 import { AnyNumber } from '@polkadot/types/types';
 import { BTreeMap, BTreeSet, Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64 } from '@polkadot/types/primitive';
-import { Actor, ActorId, ApplicationId, ApplyOnOpeningParameters, BuyMembershipParameters, CategoryId, ClassId, ClassPermissions, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, EntityController, EntityId, ForumUserId, GeneralProposalParameters, InputPropertyValue, InputValue, InviteMembershipParameters, MemberId, MemoText, ModeratorId, Nonce, OpeningId, OpeningType, OperationType, Poll, PostId, PostReactionId, PrivilegedActor, Property, PropertyId, ProposalDetailsOf, ProposalId, SchemaId, StakePolicy, StorageProviderId, ThreadId, ThreadMode, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
+import { Actor, ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BuyMembershipParameters, CategoryId, ClassId, ClassPermissions, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, EntityController, EntityId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InputPropertyValue, InputValue, InviteMembershipParameters, MemberId, MemoText, ModeratorId, Nonce, OpeningId, OpeningType, OperationType, ParticipantId, Poll, PostId, PostReactionId, PrivilegedActor, Property, PropertyId, ProposalDetailsOf, ProposalId, ReplyId, SchemaId, StakePolicy, StorageProviderId, ThreadId, ThreadMode, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
 import { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
 import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
@@ -146,7 +146,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      createReply: AugmentedSubmittable<(participantId: ParticipantId | null, postId: PostId | AnyNumber | Uint8Array, replyId: Option<ReplyId> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createReply: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, replyId: Option<ReplyId> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Blog owner can edit post, related to a given blog (if unlocked)
        * with a new title and/or body
@@ -174,7 +174,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      editReply: AugmentedSubmittable<(participantId: ParticipantId | null, postId: PostId | AnyNumber | Uint8Array, replyId: ReplyId | null, newText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      editReply: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, replyId: ReplyId | AnyNumber | Uint8Array, newText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Blog owner can lock posts, related to a given blog,
        * making post immutable to any actions (replies creation, post editing, etc.)
@@ -322,7 +322,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: Option<StakePolicy> | null | object | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: StakePolicy | { stake_amount?: any; leaving_unstaking_period?: any } | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Apply on a worker opening.
        * 
@@ -544,7 +544,7 @@ declare module '@polkadot/api/types/submittable' {
        * - `O(1)` doesn't depend on the state or parameters
        * # </weight>
        **/
-      fundingRequest: AugmentedSubmittable<(fundingRequests: Vec<FundingRequestParameters> | (FundingRequestParameters | null)[]) => SubmittableExtrinsic<ApiType>>;
+      fundingRequest: AugmentedSubmittable<(fundingRequests: Vec<FundingRequestParameters> | (FundingRequestParameters | { account?: any; amount?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
       /**
        * Plan the next budget refill.
        * 
@@ -960,7 +960,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: Option<StakePolicy> | null | object | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: StakePolicy | { stake_amount?: any; leaving_unstaking_period?: any } | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Apply on a worker opening.
        * 
@@ -1249,7 +1249,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      updateWorkingGroupBudget: AugmentedSubmittable<(workingGroup: WorkingGroup | 'Forum'|'Storage'|'Content'|'Membership' | number | Uint8Array, amount: BalanceOf | AnyNumber | Uint8Array, balanceKind: BalanceKind | null) => SubmittableExtrinsic<ApiType>>;
+      updateWorkingGroupBudget: AugmentedSubmittable<(workingGroup: WorkingGroup | 'Forum'|'Storage'|'Content'|'Membership' | number | Uint8Array, amount: BalanceOf | AnyNumber | Uint8Array, balanceKind: BalanceKind | 'Positive'|'Negative' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
     members: {
       /**
@@ -1448,7 +1448,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: Option<StakePolicy> | null | object | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: StakePolicy | { stake_amount?: any; leaving_unstaking_period?: any } | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Apply on a worker opening.
        * 
@@ -1663,7 +1663,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      createProposal: AugmentedSubmittable<(generalProposalParameters: GeneralProposalParameters | { member_id?: any; title?: any; description?: any; staking_account_id?: any; exact_execution_block?: any } | string | Uint8Array, proposalDetails: ProposalDetailsOf | { Text: any } | { RuntimeUpgrade: any } | { Spending: any } | { SetValidatorCount: any } | { AddWorkingGroupLeaderOpening: any } | { FillWorkingGroupLeaderOpening: any } | { SetWorkingGroupBudgetCapacity: any } | { DecreaseWorkingGroupLeaderStake: any } | { SlashWorkingGroupLeaderStake: any } | { SetWorkingGroupLeaderReward: any } | { TerminateWorkingGroupLeaderRole: any } | { AmendConstitution: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createProposal: AugmentedSubmittable<(generalProposalParameters: GeneralProposalParameters | { member_id?: any; title?: any; description?: any; staking_account_id?: any; exact_execution_block?: any } | string | Uint8Array, proposalDetails: ProposalDetailsOf | { Signal: any } | { RuntimeUpgrade: any } | { FundingRequest: any } | { SetMaxValidatorCount: any } | { CreateWorkingGroupLeadOpening: any } | { FillWorkingGroupLeadOpening: any } | { UpdateWorkingGroupBudget: any } | { DecreaseWorkingGroupLeadStake: any } | { SlashWorkingGroupLead: any } | { SetWorkingGroupLeadReward: any } | { TerminateWorkingGroupLead: any } | { AmendConstitution: any } | { CancelWorkingGroupLeadOpening: any } | { SetMembershipPrice: any } | { SetCouncilBudgetIncrement: any } | { SetCouncilorReward: any } | { SetInitialInvitationBalance: any } | { SetInitialInvitationCount: any } | { SetMembershipLeadInvitationQuota: any } | { SetReferralCut: any } | { CreateBlogPost: any } | { EditBlogPost: any } | { LockBlogPost: any } | { UnlockBlogPost: any } | { VetoProposal: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
     proposalsDiscussion: {
       /**
@@ -2313,7 +2313,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: Option<StakePolicy> | null | object | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addOpening: AugmentedSubmittable<(description: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Regular' | number | Uint8Array, stakePolicy: StakePolicy | { stake_amount?: any; leaving_unstaking_period?: any } | string | Uint8Array, rewardPerBlock: Option<BalanceOf> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Apply on a worker opening.
        * 

File diff suppressed because it is too large
+ 0 - 0
types/augment/augment-types.ts


+ 23 - 0
types/src/blog.ts

@@ -0,0 +1,23 @@
+import { JoyStructDecorated, MemberId, Hash, PostId } from './common'
+import { Text, Option, u64 } from '@polkadot/types'
+
+export class ParticipantId extends MemberId {}
+export class Title extends Text {}
+export class UpdatedTitle extends Option.with(Text) {}
+export class UpdatedBody extends Option.with(Text) {}
+export class ReplyId extends u64 {}
+
+export class Reply extends JoyStructDecorated({
+  text_hash: Hash,
+  owner: ParticipantId,
+  parent_id: PostId,
+}) {}
+
+export default {
+  ParticipantId,
+  Title,
+  UpdatedTitle,
+  UpdatedBody,
+  ReplyId,
+  Reply,
+}

+ 6 - 0
types/src/common.ts

@@ -134,6 +134,11 @@ export class WorkingGroup extends JoyEnum(WorkingGroupDef) {}
 
 export class MemoText extends Text {}
 
+export class BalanceKind extends JoyEnum({
+  Positive: Null,
+  Negative: Null,
+}) {}
+
 // @polkadot/types overrides required since migration to Substrate 2.0,
 // see: https://polkadot.js.org/docs/api/FAQ#i-cannot-send-transactions-sending-yields-address-decoding-failures
 export class AccountId extends GenericAccountId {}
@@ -149,6 +154,7 @@ export const commonTypes: RegistryTypes = {
   InputValidationLengthConstraint,
   WorkingGroup,
   MemoText,
+  BalanceKind,
   // Customize Address type for joystream chain
   Address,
   LookupSource,

+ 2 - 0
types/src/forum.ts

@@ -73,6 +73,8 @@ export const forumTypes: RegistryTypes = {
   PollAlternative,
   Poll,
   PrivilegedActor,
+  // runtime alias
+  ThreadOf: Thread,
 }
 
 export default forumTypes

+ 2 - 0
types/src/index.ts

@@ -6,6 +6,7 @@ import forum from './forum'
 import workingGroup from './working-group'
 import discovery from './discovery'
 import media from './media'
+import blog from './blog'
 import proposals from './proposals'
 import contentDirectory from './content-directory'
 import referendum from './referendum'
@@ -27,6 +28,7 @@ export const types: RegistryTypes = {
   ...workingGroup,
   ...discovery,
   ...media,
+  ...blog,
   ...proposals,
   ...contentDirectory,
   ...referendum,

+ 46 - 20
types/src/proposals.ts

@@ -1,7 +1,7 @@
 import { Text, u32, Tuple, u8, u128, Vec, Option, Null, Bytes } from '@polkadot/types'
 import { BlockNumber, Balance } from '@polkadot/types/interfaces'
-import { AccountId, MemberId, WorkingGroup, JoyEnum, JoyStructDecorated } from './common'
-import { ApplicationId, OpeningId, Penalty, StakePolicy, WorkerId } from './working-group'
+import { AccountId, MemberId, WorkingGroup, JoyEnum, JoyStructDecorated, BalanceKind, PostId } from './common'
+import { ApplicationId, OpeningId, StakePolicy, WorkerId } from './working-group'
 
 export type IVotingResults = {
   abstensions: u32
@@ -191,21 +191,21 @@ export class GeneralProposalParameters
   })
   implements IGeneralProposalParameters {}
 
-export type IAddOpeningParameters = {
+export type ICreateOpeningParameters = {
   description: Text
-  stake_policy: Option<StakePolicy>
+  stake_policy: StakePolicy
   reward_per_block: Option<Balance>
   working_group: WorkingGroup
 }
 
-export class AddOpeningParameters
+export class CreateOpeningParameters
   extends JoyStructDecorated({
     description: Text,
-    stake_policy: Option.with(StakePolicy),
+    stake_policy: StakePolicy,
     reward_per_block: Option.with(u128),
     working_group: WorkingGroup,
   })
-  implements IAddOpeningParameters {}
+  implements ICreateOpeningParameters {}
 
 export type IFillOpeningParameters = {
   opening_id: OpeningId
@@ -223,31 +223,56 @@ export class FillOpeningParameters
 
 export type ITerminateRoleParameters = {
   worker_id: WorkerId
-  penalty: Option<Penalty>
+  slashing_amount: Option<Balance>
   working_group: WorkingGroup
 }
 
 export class TerminateRoleParameters
   extends JoyStructDecorated({
     worker_id: WorkerId,
-    penalty: Option.with(Penalty),
+    slashing_amount: Option.with(u128),
     working_group: WorkingGroup,
   })
   implements ITerminateRoleParameters {}
 
+export type IFundingRequestParameters = {
+  account: AccountId
+  amount: Balance
+}
+
+export class FundingRequestParameters
+  extends JoyStructDecorated({
+    account: AccountId,
+    amount: u128,
+  })
+  implements IFundingRequestParameters {}
+
 export class ProposalDetails extends JoyEnum({
-  Text: Text,
+  Signal: Text,
   RuntimeUpgrade: Bytes,
-  Spending: SpendingParams,
-  SetValidatorCount: u32,
-  AddWorkingGroupLeaderOpening: AddOpeningParameters,
-  FillWorkingGroupLeaderOpening: FillOpeningParameters,
-  SetWorkingGroupBudgetCapacity: Tuple.with(['Balance', WorkingGroup]),
-  DecreaseWorkingGroupLeaderStake: Tuple.with([WorkerId, 'Balance', WorkingGroup]),
-  SlashWorkingGroupLeaderStake: Tuple.with([WorkerId, 'Balance', WorkingGroup]),
-  SetWorkingGroupLeaderReward: Tuple.with([WorkerId, 'Balance', WorkingGroup]),
-  TerminateWorkingGroupLeaderRole: TerminateRoleParameters,
+  FundingRequest: Vec.with(FundingRequestParameters),
+  SetMaxValidatorCount: u32,
+  CreateWorkingGroupLeadOpening: CreateOpeningParameters,
+  FillWorkingGroupLeadOpening: FillOpeningParameters,
+  UpdateWorkingGroupBudget: Tuple.with(['Balance', WorkingGroup, BalanceKind]),
+  DecreaseWorkingGroupLeadStake: Tuple.with([WorkerId, 'Balance', WorkingGroup]),
+  SlashWorkingGroupLead: Tuple.with([WorkerId, 'Balance', WorkingGroup]),
+  SetWorkingGroupLeadReward: Tuple.with([WorkerId, 'Option<Balance>', WorkingGroup]),
+  TerminateWorkingGroupLead: TerminateRoleParameters,
   AmendConstitution: Text,
+  CancelWorkingGroupLeadOpening: Tuple.with([OpeningId, WorkingGroup]),
+  SetMembershipPrice: u128,
+  SetCouncilBudgetIncrement: u128,
+  SetCouncilorReward: u128,
+  SetInitialInvitationBalance: u128,
+  SetInitialInvitationCount: u32,
+  SetMembershipLeadInvitationQuota: u32,
+  SetReferralCut: u128,
+  CreateBlogPost: Tuple.with([Text, Text]),
+  EditBlogPost: Tuple.with([PostId, Option.with(Text), Option.with(Text)]),
+  LockBlogPost: PostId,
+  UnlockBlogPost: PostId,
+  VetoProposal: ProposalId,
 } as const) {}
 
 // Discussions
@@ -283,7 +308,7 @@ export const proposalsTypes = {
   VoteKind,
   DiscussionThread,
   DiscussionPost,
-  AddOpeningParameters,
+  CreateOpeningParameters,
   FillOpeningParameters,
   TerminateRoleParameters,
   ProposalDecision,
@@ -292,6 +317,7 @@ export const proposalsTypes = {
   SetLeadParams,
   ThreadMode,
   ExecutionStatus,
+  FundingRequestParameters,
 }
 
 export default proposalsTypes

+ 2 - 0
types/src/scripts/generateAugmentCodec.ts

@@ -19,6 +19,7 @@ import proposals from '../proposals'
 import contentDirectory from '../content-directory'
 import referendum from '../referendum'
 import constitution from '../constitution'
+import blog from '../blog'
 
 const AUGMENT_INTERFACES_PATH = path.join(__dirname, '../../augment')
 const AUGMENT_CODEC_PATH = path.join(__dirname, '../../augment-codec')
@@ -37,6 +38,7 @@ const typesByModule = {
   'content-directory': contentDirectory,
   'referendum': referendum,
   'constitution': constitution,
+  'blog': blog,
 }
 
 type Imports = { [moduleName: string]: string[] }

+ 12 - 10
types/src/working-group/index.ts

@@ -15,18 +15,20 @@ export class ApplicationIdToWorkerIdMap extends BTreeMap.with(ApplicationId, Wor
 export type IApplication = {
   role_account_id: AccountId
   reward_account_id: AccountId
-  staking_account_id: Option<AccountId>
+  staking_account_id: AccountId
   member_id: MemberId
-  description_hash: Text
+  description_hash: Bytes
+  opening_id: OpeningId
 }
 
 export class Application
   extends JoyStructDecorated({
     role_account_id: AccountId,
     reward_account_id: AccountId,
-    staking_account_id: Option.with(AccountId),
+    staking_account_id: AccountId,
     member_id: MemberId,
-    description_hash: Text,
+    description_hash: Bytes,
+    opening_id: OpeningId,
   })
   implements IApplication {}
 
@@ -45,7 +47,7 @@ export class ApplicationInfo
 export type IWorker = {
   member_id: MemberId
   role_account_id: AccountId
-  staking_account_id: Option<AccountId>
+  staking_account_id: AccountId
   reward_account_id: AccountId
   started_leaving_at: Option<BlockNumber>
   job_unstaking_period: BlockNumber
@@ -58,7 +60,7 @@ export class Worker
   extends JoyStructDecorated({
     member_id: MemberId,
     role_account_id: AccountId,
-    staking_account_id: Option.with(AccountId),
+    staking_account_id: AccountId,
     reward_account_id: AccountId,
     started_leaving_at: Option.with(u32),
     job_unstaking_period: u32,
@@ -114,7 +116,7 @@ export type IApplyOnOpeningParameters = {
   role_account_id: AccountId
   reward_account_id: AccountId
   description: Text
-  stake_parameters: Option<StakeParameters>
+  stake_parameters: StakeParameters
 }
 
 export class ApplyOnOpeningParameters
@@ -124,7 +126,7 @@ export class ApplyOnOpeningParameters
     role_account_id: AccountId,
     reward_account_id: AccountId,
     description: Text,
-    stake_parameters: Option.with(StakeParameters),
+    stake_parameters: StakeParameters,
   })
   implements IApplyOnOpeningParameters {}
 
@@ -153,7 +155,7 @@ export type IOpening = {
   opening_type: OpeningType
   created: BlockNumber
   description_hash: Bytes
-  stake_policy: Option<StakePolicy>
+  stake_policy: StakePolicy
   reward_per_block: Option<Balance>
 }
 
@@ -162,7 +164,7 @@ export class Opening
     opening_type: OpeningType,
     created: u32,
     description_hash: Bytes,
-    stake_policy: Option.with(StakePolicy),
+    stake_policy: StakePolicy,
     reward_per_block: Option.with(u128),
   })
   implements IOpening {}

Some files were not shown because too many files changed in this diff