Browse Source

Update @polkadot/api, @joystream/types, query-node, integration-tests, remove BTree(Set|Map) workarounds

Leszek Wiesner 3 years ago
parent
commit
fcd1ad162e
41 changed files with 341 additions and 825 deletions
  1. 2 2
      cli/package.json
  2. 1 1
      cli/src/Api.ts
  3. 3 2
      cli/src/commands/working-groups/fillOpening.ts
  4. 1 1
      metadata-protobuf/package.json
  5. 9 12
      package.json
  6. 1 1
      pioneer/packages/react-api/package.json
  7. 1 7
      query-node/mappings/forum.ts
  8. 1 1
      query-node/mappings/package.json
  9. 1 1
      storage-node/package.json
  10. 1 1
      storage-node/packages/runtime-api/package.json
  11. 4 4
      tests/integration-tests/package.json
  12. 14 2
      tests/integration-tests/src/Api.ts
  13. 1 1
      tests/integration-tests/src/QueryNodeApi.ts
  14. 1 1
      tests/integration-tests/src/Scenario.ts
  15. 8 5
      tests/integration-tests/src/fixtures/forum/DeletePostsFixture.ts
  16. 2 2
      tests/integration-tests/src/fixtures/workingGroups/FillOpeningsFixture.ts
  17. 2 1
      tests/integration-tests/src/types.ts
  18. 1 1
      types/augment-codec/all.ts
  19. 2 3
      types/augment-codec/augment-api-events.ts
  20. 16 16
      types/augment-codec/augment-api-query.ts
  21. 31 5
      types/augment-codec/augment-api-rpc.ts
  22. 6 6
      types/augment-codec/augment-api-tx.ts
  23. 0 1
      types/augment-codec/augment-types.ts
  24. 18 9
      types/augment/all/defs.json
  25. 20 6
      types/augment/all/types.ts
  26. 2 3
      types/augment/augment-api-events.ts
  27. 16 16
      types/augment/augment-api-query.ts
  28. 31 5
      types/augment/augment-api-rpc.ts
  29. 6 6
      types/augment/augment-api-tx.ts
  30. 0 1
      types/augment/augment-types.ts
  31. 5 5
      types/package.json
  32. 3 3
      types/src/bounty.ts
  33. 2 63
      types/src/common.ts
  34. 3 3
      types/src/content/index.ts
  35. 15 10
      types/src/forum.ts
  36. 2 0
      types/src/index.ts
  37. 5 3
      types/src/working-group/index.ts
  38. 7 7
      utils/api-scripts/package.json
  39. 3 2
      utils/api-scripts/src/initialize-lead.ts
  40. 3 2
      utils/api-scripts/src/initialize-worker.ts
  41. 91 604
      yarn.lock

+ 2 - 2
cli/package.json

@@ -19,7 +19,7 @@
     "@oclif/plugin-help": "^3.2.2",
     "@oclif/plugin-not-found": "^1.2.4",
     "@oclif/plugin-warn-if-update-available": "^1.7.0",
-    "@polkadot/api": "4.2.1",
+    "@polkadot/api": "5.3.2",
     "@types/cli-progress": "^3.9.1",
     "@types/fluent-ffmpeg": "^2.1.16",
     "@types/inquirer": "^6.5.0",
@@ -49,7 +49,7 @@
   "devDependencies": {
     "@oclif/dev-cli": "^1.22.2",
     "@oclif/test": "^1.2.5",
-    "@polkadot/ts": "^0.3.62",
+    "@polkadot/ts": "^0.4.4",
     "@types/chai": "^4.2.11",
     "@types/mocha": "^5.2.7",
     "@types/node": "^10.17.18",

+ 1 - 1
cli/src/Api.ts

@@ -42,7 +42,7 @@ import {
   VideoCategory,
 } from '@joystream/types/content'
 import { ContentId, DataObject } from '@joystream/types/storage'
-import { ApolloClient, InMemoryCache, HttpLink, NormalizedCacheObject, DocumentNode } from '@apollo/client'
+import { ApolloClient, InMemoryCache, HttpLink, NormalizedCacheObject, DocumentNode } from '@apollo/client/core'
 import fetch from 'cross-fetch'
 import { Maybe } from './graphql/generated/schema'
 import {

+ 3 - 2
cli/src/commands/working-groups/fillOpening.ts

@@ -1,8 +1,9 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
 import { apiModuleByGroup } from '../../Api'
 import chalk from 'chalk'
-import { JoyBTreeSet } from '@joystream/types/common'
 import { ApplicationId } from '@joystream/types/working-group'
+import { BTreeSet } from '@polkadot/types'
+import { registry } from '@joystream/types'
 
 export default class WorkingGroupsFillOpening extends WorkingGroupsCommandBase {
   static description = "Allows filling working group opening that's currently in review. Requires lead access."
@@ -33,7 +34,7 @@ export default class WorkingGroupsFillOpening extends WorkingGroupsCommandBase {
       await this.getDecodedPair(lead.roleAccount.toString()),
       apiModuleByGroup[this.group],
       'fillOpening',
-      [openingId, new (JoyBTreeSet(ApplicationId))(this.getTypesRegistry(), applicationIds)]
+      [openingId, new (BTreeSet.with(ApplicationId))(registry, applicationIds)]
     )
 
     this.log(chalk.green(`Opening ${chalk.magentaBright(openingId.toString())} succesfully filled!`))

+ 1 - 1
metadata-protobuf/package.json

@@ -49,7 +49,7 @@
     "mocha": "^8.2.1",
     "prettier": "2.0.2",
     "ts-node": "^8.8.1",
-    "typescript": "^4.1.3",
+    "typescript": "^4.3.5",
     "protobufjs": "^6.11.2"
   }
 }

+ 9 - 12
package.json

@@ -20,8 +20,6 @@
     "storage-node/packages/*",
     "devops/eslint-config",
     "devops/prettier-config",
-    "pioneer",
-    "pioneer/packages/*",
     "utils/api-scripts",
     "query-node",
     "query-node/mappings",
@@ -29,18 +27,17 @@
     "metadata-protobuf"
   ],
   "resolutions": {
-    "@polkadot/api": "4.2.1",
-    "@polkadot/api-contract": "4.2.1",
-    "@polkadot/keyring": "^6.0.5",
-    "@polkadot/metadata": "4.2.1",
-    "@polkadot/types": "4.2.1",
-    "@polkadot/util": "^6.0.5",
-    "@polkadot/util-crypto": "^6.0.5",
-    "@polkadot/wasm-crypto": "^4.0.2",
+    "@polkadot/api": "5.3.2",
+    "@polkadot/api-contract": "5.3.2",
+    "@polkadot/types": "5.3.2",
+    "@polkadot/keyring": "^7.1.1",
+    "@polkadot/util": "^7.1.1",
+    "@polkadot/util-crypto": "^7.1.1",
+    "@polkadot/wasm-crypto": "^4.1.2",
     "babel-core": "^7.0.0-bridge.0",
-    "typescript": "3.8.*",
+    "typescript": "^4.3.5",
     "bn.js": "^5.1.2",
-    "rxjs": "^6.6.2",
+    "rxjs": "^7.2.0",
     "typeorm": "^0.2.31",
     "pg": "^8.4.0",
     "chalk": "^4.0.0"

+ 1 - 1
pioneer/packages/react-api/package.json

@@ -31,7 +31,7 @@
   "homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
   "dependencies": {
     "@babel/runtime": "^7.10.5",
-    "@polkadot/api": "4.2.1",
+    "@polkadot/api": "5.3.2",
     "@polkadot/extension-dapp": "^0.32.0-beta.10",
     "rxjs-compat": "^6.6.0"
   }

+ 1 - 7
query-node/mappings/forum.ts

@@ -668,12 +668,6 @@ export async function forum_PostTextUpdated({ event, store }: EventContext & Sto
 }
 
 export async function forum_PostDeleted({ event, store }: EventContext & StoreContext): Promise<void> {
-  // FIXME: Custom posts BTreeMap fix (because of invalid BTreeMap json encoding/decoding)
-  // See: https://github.com/polkadot-js/api/pull/3789
-  event.params[2].value = new Map(
-    Object.entries(event.params[2].value).map(([key, val]) => [JSON.parse(key), val])
-  ) as any
-
   const [rationaleBytes, userId, postsData] = new Forum.PostDeletedEvent(event).params
   const eventTime = new Date(event.blockTimestamp)
 
@@ -686,7 +680,7 @@ export async function forum_PostDeleted({ event, store }: EventContext & StoreCo
   await store.save<PostDeletedEvent>(postDeletedEvent)
 
   await Promise.all(
-    Array.from(postsData.entries()).map(async ([[, , postId], hideFlag]) => {
+    Array.from(postsData.entries()).map(async ([{ post_id: postId }, hideFlag]) => {
       const post = await getPost(store, postId.toString(), ['thread'])
       const newStatus = hideFlag.valueOf() ? new PostStatusRemoved() : new PostStatusLocked()
       newStatus.postDeletedEventId = postDeletedEvent.id

+ 1 - 1
query-node/mappings/package.json

@@ -19,6 +19,6 @@
   },
   "devDependencies": {
     "ts-node": "^9.0.0",
-    "typescript": "^3.8"
+    "typescript": "^4.3.5"
   }
 }

+ 1 - 1
storage-node/package.json

@@ -46,7 +46,7 @@
     "eslint-plugin-babel": "^5.3.1",
     "eslint-plugin-prettier": "^3.1.4",
     "prettier": "^2.0.5",
-    "typescript": "^3.9.6",
+    "typescript": "^4.3.5",
     "wsrun": "^3.6.5"
   },
   "volta": {

+ 1 - 1
storage-node/packages/runtime-api/package.json

@@ -50,7 +50,7 @@
   "dependencies": {
     "@joystream/storage-utils": "^0.1.0",
     "@joystream/types": "^0.17.0",
-    "@polkadot/api": "4.2.1",
+    "@polkadot/api": "5.3.2",
     "async-lock": "^1.2.0",
     "lodash": "^4.17.11",
     "password-prompt": "^1.1.2"

+ 4 - 4
tests/integration-tests/package.json

@@ -16,8 +16,8 @@
   "dependencies": {
     "@apollo/client": "^3.2.5",
     "@joystream/types": "^0.17.0",
-    "@polkadot/api": "4.2.1",
-    "@polkadot/keyring": "^6.0.5",
+    "@polkadot/api": "5.3.2",
+    "@polkadot/keyring": "^7.1.1",
     "@types/async-lock": "^1.1.2",
     "@types/bn.js": "^4.11.5",
     "@types/lowdb": "^1.0.9",
@@ -29,13 +29,13 @@
     "uuid": "^7.0.3"
   },
   "devDependencies": {
-    "@polkadot/ts": "^0.3.14",
+    "@polkadot/ts": "^0.4.4",
     "@types/chai": "^4.2.11",
     "@types/uuid": "^7.0.2",
     "chai": "^4.2.0",
     "prettier": "2.0.2",
     "ts-node": "^8.8.1",
-    "typescript": "^3.8.3",
+    "typescript": "^4.3.5",
     "@graphql-codegen/cli": "^1.21.4",
     "@graphql-codegen/typescript": "^1.22.0",
     "@graphql-codegen/import-types-preset": "^1.18.1",

+ 14 - 2
tests/integration-tests/src/Api.ts

@@ -31,6 +31,7 @@ import {
   CategoryCreatedEventDetails,
   PostAddedEventDetails,
   ThreadCreatedEventDetails,
+  ProposalsCodexEventName,
 } from './types'
 import {
   ApplicationId,
@@ -442,6 +443,17 @@ export class Api {
     return details
   }
 
+  public async retrieveProposalsCodexEventDetails(
+    result: ISubmittableResult,
+    eventName: ProposalsCodexEventName
+  ): Promise<EventDetails> {
+    const details = await this.retrieveEventDetails(result, 'proposalsCodex', eventName)
+    if (!details) {
+      throw new Error(`${eventName} event details not found in result: ${JSON.stringify(result.toHuman())}`)
+    }
+    return details
+  }
+
   public async retrieveForumEventDetails(result: ISubmittableResult, eventName: ForumEventName): Promise<EventDetails> {
     const details = await this.retrieveEventDetails(result, 'forum', eventName)
     if (!details) {
@@ -451,10 +463,10 @@ export class Api {
   }
 
   public async retrieveProposalCreatedEventDetails(result: ISubmittableResult): Promise<ProposalCreatedEventDetails> {
-    const details = await this.retrieveProposalsEngineEventDetails(result, 'ProposalCreated')
+    const details = await this.retrieveProposalsCodexEventDetails(result, 'ProposalCreated')
     return {
       ...details,
-      proposalId: details.event.data[1] as ProposalId,
+      proposalId: details.event.data[0] as ProposalId,
     }
   }
 

+ 1 - 1
tests/integration-tests/src/QueryNodeApi.ts

@@ -1,4 +1,4 @@
-import { ApolloClient, DocumentNode, NormalizedCacheObject } from '@apollo/client'
+import { ApolloClient, DocumentNode, NormalizedCacheObject } from '@apollo/client/core'
 import { MemberId, PostId, ThreadId } from '@joystream/types/common'
 import { extendDebug, Debugger } from './Debugger'
 import { ApplicationId, OpeningId, WorkerId } from '@joystream/types/working-group'

+ 1 - 1
tests/integration-tests/src/Scenario.ts

@@ -2,7 +2,7 @@ import { WsProvider } from '@polkadot/api'
 import { ApiFactory } from './Api'
 import { QueryNodeApi } from './QueryNodeApi'
 import { config } from 'dotenv'
-import { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client'
+import { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client/core'
 import { extendDebug, Debugger } from './Debugger'
 import { Flow } from './Flow'
 import { Job } from './Job'

+ 8 - 5
tests/integration-tests/src/fixtures/forum/DeletePostsFixture.ts

@@ -7,10 +7,10 @@ import { ISubmittableResult } from '@polkadot/types/types/'
 import { ForumPostFieldsFragment, PostDeletedEventFieldsFragment } from '../../graphql/generated/queries'
 import { assert } from 'chai'
 import { StandardizedFixture } from '../../Fixture'
-import { MemberId, PostId, ThreadId } from '@joystream/types/common'
-import { CategoryId, PostsToDeleteMap } from '@joystream/types/forum'
+import { MemberId, PostId } from '@joystream/types/common'
+import { ExtendedPostId, PostsToDeleteMap } from '@joystream/types/forum'
 import _ from 'lodash'
-import { registry } from '../../../../../types'
+import { registry } from '@joystream/types'
 
 const DEFAULT_RATIONALE = 'State cleanup'
 
@@ -43,8 +43,11 @@ export class DeletePostsFixture extends StandardizedFixture {
   protected async getExtrinsics(): Promise<SubmittableExtrinsic<'promise'>[]> {
     return this.removals.map((r) => {
       const postsToDeleteEntries = r.posts.map(
-        ({ categoryId, threadId, postId, hide }) =>
-          [[categoryId, threadId, postId], hide === undefined || hide] as [[CategoryId, ThreadId, PostId], boolean]
+        ({ hide, categoryId, threadId, postId }) =>
+          [
+            this.api.createType('ExtendedPostId', { post_id: postId, thread_id: threadId, category_id: categoryId }),
+            hide === undefined || hide,
+          ] as [ExtendedPostId, boolean]
       )
       const postsToDeleteMap = new PostsToDeleteMap(registry, new Map(postsToDeleteEntries))
       return this.api.tx.forum.deletePosts(r.asMember, postsToDeleteMap, r.rationale || DEFAULT_RATIONALE)

+ 2 - 2
tests/integration-tests/src/fixtures/workingGroups/FillOpeningsFixture.ts

@@ -8,7 +8,7 @@ import { Application, ApplicationId, Opening, OpeningId, WorkerId } from '@joyst
 import { SubmittableExtrinsic } from '@polkadot/api/types'
 import { ISubmittableResult } from '@polkadot/types/types/'
 import { Utils } from '../../utils'
-import { JoyBTreeSet } from '@joystream/types/common'
+import { BTreeSet } from '@polkadot/types'
 import { registry } from '@joystream/types'
 import { lockIdByWorkingGroup } from '../../consts'
 import {
@@ -55,7 +55,7 @@ export class FillOpeningsFixture extends BaseWorkingGroupFixture {
 
   protected async getExtrinsics(): Promise<SubmittableExtrinsic<'promise'>[]> {
     const extrinsics = this.openingIds.map((openingId, i) => {
-      const applicationsSet = new (JoyBTreeSet(ApplicationId))(registry, this.acceptedApplicationsIdsArrays[i])
+      const applicationsSet = new (BTreeSet.with(ApplicationId))(registry, this.acceptedApplicationsIdsArrays[i])
       this.debug(
         'Applications to accept:',
         this.acceptedApplicationsIdsArrays[i].map((id) => id.toNumber())

+ 2 - 1
tests/integration-tests/src/types.ts

@@ -109,13 +109,14 @@ export interface ProposalCreatedEventDetails extends EventDetails {
 }
 
 export type ProposalsEngineEventName =
-  | 'ProposalCreated'
   | 'ProposalStatusUpdated'
   | 'ProposalDecisionMade'
   | 'ProposalExecuted'
   | 'Voted'
   | 'ProposalCancelled'
 
+export type ProposalsCodexEventName = 'ProposalCreated'
+
 export type ProposalType = keyof typeof ProposalDetails.typeDefinitions
 export type ProposalDetailsJsonByType<T extends ProposalType = ProposalType> = CreateInterface<
   InstanceType<ProposalDetails['typeDefinitions'][T]>

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


+ 2 - 3
types/augment-codec/augment-api-events.ts

@@ -2,8 +2,7 @@
 /* eslint-disable */
 
 import type { BTreeMap, BTreeSet, Bytes, Option, Text, Vec, bool, u32, u64, u8 } from '@polkadot/types';
-import type { ITuple } from '@polkadot/types/types';
-import type { ActorId, ApplicationId, ApplicationIdToWorkerIdMap, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, Channel, ChannelCategory, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentActor, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, EntryId, ExecutionStatus, ForumUserId, GeneralProposalParameters, InviteMembershipParameters, IsCensored, MemberId, MemoText, ModeratorId, NewAsset, OpeningId, OpeningType, OptionResult, OracleJudgment, ParticipantId, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PollInput, PostId, PostReactionId, PrivilegedActor, ProposalDecision, ProposalDetailsOf, ProposalId, ProposalStatus, ReplyId, RewardPaymentType, Series, SeriesId, SeriesParameters, StakePolicy, StorageObjectOwner, StorageProviderId, ThreadId, ThreadMode, Title, UpdatedBody, UpdatedTitle, UploadingStatus, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, VoucherLimit, WorkerId, WorkingGroup } from './all';
+import type { ActorId, ApplicationId, ApplicationIdToWorkerIdMap, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, Channel, ChannelCategory, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentActor, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, EntryId, ExecutionStatus, ExtendedPostId, ForumUserId, GeneralProposalParameters, InviteMembershipParameters, IsCensored, MemberId, MemoText, ModeratorId, NewAsset, OpeningId, OpeningType, OptionResult, OracleJudgment, ParticipantId, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PollInput, PostId, PostReactionId, PrivilegedActor, ProposalDecision, ProposalDetailsOf, ProposalId, ProposalStatus, ReplyId, RewardPaymentType, Series, SeriesId, SeriesParameters, StakePolicy, StorageObjectOwner, StorageProviderId, ThreadId, ThreadMode, Title, UpdatedBody, UpdatedTitle, UploadingStatus, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, VoucherLimit, WorkerId, WorkingGroup } from './all';
 import type { BalanceStatus } from '@polkadot/types/interfaces/balances';
 import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
 import type { AuthorityList } from '@polkadot/types/interfaces/grandpa';
@@ -622,7 +621,7 @@ declare module '@polkadot/api/types/events' {
       /**
        * Post with givne id was deleted.
        **/
-      PostDeleted: AugmentedEvent<ApiType, [Bytes, ForumUserId, BTreeMap<ITuple<[CategoryId, ThreadId, PostId]>, bool>]>;
+      PostDeleted: AugmentedEvent<ApiType, [Bytes, ForumUserId, BTreeMap<ExtendedPostId, bool>]>;
       /**
        * Post with givne id was moderated.
        **/

+ 16 - 16
types/augment-codec/augment-api-query.ts

@@ -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 | AnyNumber | Uint8Array) => Observable<Reply>, [PostId, ReplyId]>;
+      replyById: AugmentedQuery<ApiType, (arg1: PostId | AnyNumber | Uint8Array, arg2: ReplyId | AnyNumber | Uint8Array) => Observable<Reply>, [PostId, ReplyId]>;
     };
     bounty: {
       /**
@@ -150,7 +150,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Double map for bounty funding. It stores a member or council funding for bounties.
        **/
-      bountyContributions: AugmentedQueryDoubleMap<ApiType, (key1: BountyId | AnyNumber | Uint8Array, key2: BountyActor | { Council: any } | { Member: any } | string | Uint8Array) => Observable<BalanceOf>, [BountyId, BountyActor]>;
+      bountyContributions: AugmentedQuery<ApiType, (arg1: BountyId | AnyNumber | Uint8Array, arg2: BountyActor | { Council: any } | { Member: any } | string | Uint8Array) => Observable<BalanceOf>, [BountyId, BountyActor]>;
       /**
        * Count of all bounties that have been created.
        **/
@@ -349,7 +349,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Moderator set for each Category
        **/
-      categoryByModerator: AugmentedQueryDoubleMap<ApiType, (key1: CategoryId | AnyNumber | Uint8Array, key2: ModeratorId | AnyNumber | Uint8Array) => Observable<ITuple<[]>>, [CategoryId, ModeratorId]>;
+      categoryByModerator: AugmentedQuery<ApiType, (arg1: CategoryId | AnyNumber | Uint8Array, arg2: ModeratorId | AnyNumber | Uint8Array) => Observable<ITuple<[]>>, [CategoryId, ModeratorId]>;
       /**
        * Counter for all existing categories.
        **/
@@ -373,15 +373,15 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Unique thread poll voters. This private double map prevents double voting.
        **/
-      pollVotes: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: ForumUserId | AnyNumber | Uint8Array) => Observable<bool>, [ThreadId, ForumUserId]>;
+      pollVotes: AugmentedQuery<ApiType, (arg1: ThreadId | AnyNumber | Uint8Array, arg2: ForumUserId | AnyNumber | Uint8Array) => Observable<bool>, [ThreadId, ForumUserId]>;
       /**
        * Map post identifier to corresponding post.
        **/
-      postById: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: PostId | AnyNumber | Uint8Array) => Observable<Post>, [ThreadId, PostId]>;
+      postById: AugmentedQuery<ApiType, (arg1: ThreadId | AnyNumber | Uint8Array, arg2: PostId | AnyNumber | Uint8Array) => Observable<Post>, [ThreadId, PostId]>;
       /**
        * Map thread identifier to corresponding thread.
        **/
-      threadById: AugmentedQueryDoubleMap<ApiType, (key1: CategoryId | AnyNumber | Uint8Array, key2: ThreadId | AnyNumber | Uint8Array) => Observable<ThreadOf>, [CategoryId, ThreadId]>;
+      threadById: AugmentedQuery<ApiType, (arg1: CategoryId | AnyNumber | Uint8Array, arg2: ThreadId | AnyNumber | Uint8Array) => Observable<ThreadOf>, [CategoryId, ThreadId]>;
     };
     forumWorkingGroup: {
       /**
@@ -518,7 +518,7 @@ declare module '@polkadot/api/types/storage' {
        * For each session index, we keep a mapping of `T::ValidatorId` to the
        * number of blocks authored by the given authority.
        **/
-      authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>, [SessionIndex, ValidatorId]>;
+      authoredBlocks: AugmentedQuery<ApiType, (arg1: SessionIndex | AnyNumber | Uint8Array, arg2: ValidatorId | string | Uint8Array) => Observable<u32>, [SessionIndex, ValidatorId]>;
       /**
        * The block number after which it's ok to send heartbeats in current session.
        * 
@@ -536,7 +536,7 @@ declare module '@polkadot/api/types/storage' {
        * For each session index, we keep a mapping of `AuthIndex` to
        * `offchain::OpaqueNetworkState`.
        **/
-      receivedHeartbeats: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: AuthIndex | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [SessionIndex, AuthIndex]>;
+      receivedHeartbeats: AugmentedQuery<ApiType, (arg1: SessionIndex | AnyNumber | Uint8Array, arg2: AuthIndex | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [SessionIndex, AuthIndex]>;
     };
     members: {
       /**
@@ -631,7 +631,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * A vector of reports of the same kind that happened at the same time slot.
        **/
-      concurrentReportsIndex: AugmentedQueryDoubleMap<ApiType, (key1: Kind | string | Uint8Array, key2: OpaqueTimeSlot | string | Uint8Array) => Observable<Vec<ReportIdOf>>, [Kind, OpaqueTimeSlot]>;
+      concurrentReportsIndex: AugmentedQuery<ApiType, (arg1: Kind | string | Uint8Array, arg2: OpaqueTimeSlot | string | Uint8Array) => Observable<Vec<ReportIdOf>>, [Kind, OpaqueTimeSlot]>;
       /**
        * Deferred reports that have been rejected by the offence handler and need to be submitted
        * at a later time.
@@ -715,7 +715,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Map thread id and post id to corresponding post.
        **/
-      postThreadIdByPostId: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: PostId | AnyNumber | Uint8Array) => Observable<DiscussionPost>, [ThreadId, PostId]>;
+      postThreadIdByPostId: AugmentedQuery<ApiType, (arg1: ThreadId | AnyNumber | Uint8Array, arg2: PostId | AnyNumber | Uint8Array) => Observable<DiscussionPost>, [ThreadId, PostId]>;
       /**
        * Map thread identifier to corresponding thread.
        **/
@@ -745,7 +745,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Double map for preventing duplicate votes. Should be cleaned after usage.
        **/
-      voteExistsByProposalByVoter: AugmentedQueryDoubleMap<ApiType, (key1: ProposalId | AnyNumber | Uint8Array, key2: MemberId | AnyNumber | Uint8Array) => Observable<VoteKind>, [ProposalId, MemberId]>;
+      voteExistsByProposalByVoter: AugmentedQuery<ApiType, (arg1: ProposalId | AnyNumber | Uint8Array, arg2: MemberId | AnyNumber | Uint8Array) => Observable<VoteKind>, [ProposalId, MemberId]>;
     };
     randomnessCollectiveFlip: {
       /**
@@ -857,7 +857,7 @@ declare module '@polkadot/api/types/storage' {
        * 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>, [EraIndex, AccountId]>;
+      erasStakers: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<Exposure>, [EraIndex, AccountId]>;
       /**
        * Clipped Exposure of validator at era.
        * 
@@ -871,7 +871,7 @@ declare module '@polkadot/api/types/storage' {
        * Is it removed after `HISTORY_DEPTH` eras.
        * If stakers hasn't been set or has been removed then empty exposure is returned.
        **/
-      erasStakersClipped: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Exposure>, [EraIndex, AccountId]>;
+      erasStakersClipped: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<Exposure>, [EraIndex, AccountId]>;
       /**
        * The session index at which the era start for the last `HISTORY_DEPTH` eras.
        **/
@@ -888,7 +888,7 @@ declare module '@polkadot/api/types/storage' {
        * 
        * Is it removed after `HISTORY_DEPTH` eras.
        **/
-      erasValidatorPrefs: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>, [EraIndex, AccountId]>;
+      erasValidatorPrefs: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>, [EraIndex, AccountId]>;
       /**
        * The total validator era payout for the last `HISTORY_DEPTH` eras.
        * 
@@ -935,7 +935,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * All slashing events on nominators, mapped by era to the highest slash value of the era.
        **/
-      nominatorSlashInEra: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Option<BalanceOf>>, [EraIndex, AccountId]>;
+      nominatorSlashInEra: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<Option<BalanceOf>>, [EraIndex, AccountId]>;
       /**
        * Where the reward payment should be made. Keyed by stash.
        **/
@@ -998,7 +998,7 @@ declare module '@polkadot/api/types/storage' {
        * All slashing events on validators, mapped by era to the highest slash proportion
        * and slash value of the era.
        **/
-      validatorSlashInEra: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Option<ITuple<[Perbill, BalanceOf]>>>, [EraIndex, AccountId]>;
+      validatorSlashInEra: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<Option<ITuple<[Perbill, BalanceOf]>>>, [EraIndex, AccountId]>;
     };
     storageWorkingGroup: {
       /**

+ 31 - 5
types/augment-codec/augment-api-rpc.ts

@@ -1,15 +1,15 @@
 // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
 /* eslint-disable */
 
-import type { Metadata } from '@polkadot/metadata';
-import type { Bytes, HashMap, Json, Null, Option, StorageKey, Text, U256, U64, Vec, bool, u32, u64 } from '@polkadot/types';
+import type { Bytes, HashMap, Json, Metadata, Null, Option, StorageKey, Text, U256, U64, Vec, bool, u32, u64 } from '@polkadot/types';
 import type { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types';
 import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
 import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
+import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
 import type { BlockHash } from '@polkadot/types/interfaces/chain';
 import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
 import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
-import type { ContractCallRequest, ContractExecResult } from '@polkadot/types/interfaces/contracts';
+import type { ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
 import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
 import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
 import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
@@ -19,7 +19,7 @@ import type { StorageKind } from '@polkadot/types/interfaces/offchain';
 import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
 import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
 import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
-import type { ReadProof, RuntimeVersion } from '@polkadot/types/interfaces/state';
+import type { ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
 import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';
 
 declare module '@polkadot/rpc-core/types.jsonrpc' {
@@ -64,6 +64,12 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        **/
       epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;
     };
+    beefy: {
+      /**
+       * Returns the block most recently finalized by BEEFY, alongside side its justification.
+       **/
+      subscribeJustifications: AugmentedRpc<() => Observable<BeefySignedCommitment>>;
+    };
     chain: {
       /**
        * Get header and body of a relay chain block
@@ -99,6 +105,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Returns the keys with prefix from a child storage, leave empty to get all the keys
        **/
       getKeys: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
+      /**
+       * Returns the keys with prefix from a child storage with pagination support
+       **/
+      getKeysPaged: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, count: u32 | AnyNumber | Uint8Array, startKey?: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
       /**
        * Returns a child storage entry at a specific block state
        **/
@@ -121,6 +131,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Returns the value under a specified storage key in a contract
        **/
       getStorage: AugmentedRpc<(address: AccountId | string | Uint8Array, key: H256 | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<Bytes>>>;
+      /**
+       * Instantiate a new contract
+       **/
+      instantiate: AugmentedRpc<(request: InstantiateRequest | { origin?: any; endowment?: any; gasLimit?: any; code?: any; data?: any; salt?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ContractInstantiateResult>>;
       /**
        * Returns the projected time a given contract will be able to sustain paying its rent
        **/
@@ -142,7 +156,7 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        **/
       accounts: AugmentedRpc<() => Observable<Vec<H160>>>;
       /**
-       * Returns balance of the given account.
+       * Returns the blockNumber
        **/
       blockNumber: AugmentedRpc<() => Observable<U256>>;
       /**
@@ -371,6 +385,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Retrieves the keys with prefix of a specific child storage
        **/
       getChildKeys: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
+      /**
+       * Returns proof of storage for child key entries at a specific block state.
+       **/
+      getChildReadProof: AugmentedRpc<(childStorageKey: PrefixedStorageKey | string | Uint8Array, keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: BlockHash | string | Uint8Array) => Observable<ReadProof>>;
       /**
        * Retrieves the child storage for a key
        **/
@@ -435,6 +453,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Subscribes to storage changes for the provided keys
        **/
       subscribeStorage: AugmentedRpc<<T = Codec[]>(keys?: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[]) => Observable<T>>;
+      /**
+       * Provides a way to trace the re-execution of a single block
+       **/
+      traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option<Text> | null | object | string | Uint8Array, storageKeys: Option<Text> | null | object | string | Uint8Array) => Observable<TraceBlockResponse>>;
     };
     syncstate: {
       /**
@@ -503,6 +525,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Remove a reserved peer
        **/
       removeReservedPeer: AugmentedRpc<(peerId: Text | string) => Observable<Text>>;
+      /**
+       * Returns the list of reserved peers
+       **/
+      reservedPeers: AugmentedRpc<() => Observable<Vec<Text>>>;
       /**
        * Resets the log filter to Substrate defaults
        **/

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

@@ -2,8 +2,8 @@
 /* eslint-disable */
 
 import type { BTreeMap, BTreeSet, Bytes, Compact, Option, Vec, bool, u16, u32, u64, u8 } from '@polkadot/types';
-import type { AnyNumber, ITuple } from '@polkadot/types/types';
-import type { ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentActor, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, EntryId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InviteMembershipParameters, MemberId, MemoText, ModeratorId, ObjectOwner, OpeningId, OpeningType, OracleJudgment, ParticipantId, PersonActor, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PollInput, PostId, PostReactionId, PrivilegedActor, ProposalDetailsOf, ProposalId, ReplyId, ReplyToDelete, SeriesId, SeriesParameters, StakePolicy, StorageProviderId, ThreadId, ThreadMode, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, WorkerId, WorkingGroup } from './all';
+import type { AnyNumber } from '@polkadot/types/types';
+import type { ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentActor, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, EntryId, ExtendedPostId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InviteMembershipParameters, MemberId, MemoText, ModeratorId, ObjectOwner, OpeningId, OpeningType, OracleJudgment, ParticipantId, PersonActor, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PollInput, PostId, PostReactionId, PrivilegedActor, ProposalDetailsOf, ProposalId, ReplyId, ReplyToDelete, SeriesId, SeriesParameters, StakePolicy, StorageProviderId, ThreadId, ThreadMode, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, WorkerId, WorkingGroup } from './all';
 import type { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
 import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
@@ -891,7 +891,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(W + P)
        * # </weight>
        **/
-      deletePosts: AugmentedSubmittable<(forumUserId: ForumUserId | AnyNumber | Uint8Array, posts: BTreeMap<ITuple<[CategoryId, ThreadId, PostId]>, bool>, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [ForumUserId, BTreeMap<ITuple<[CategoryId, ThreadId, PostId]>, bool>, Bytes]>;
+      deletePosts: AugmentedSubmittable<(forumUserId: ForumUserId | AnyNumber | Uint8Array, posts: BTreeMap<ExtendedPostId, bool>, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [ForumUserId, BTreeMap<ExtendedPostId, bool>, Bytes]>;
       /**
        * Delete thread
        * 
@@ -2392,7 +2392,7 @@ declare module '@polkadot/api/types/submittable' {
        * - DbWrites per key id: `KeyOwner`
        * # </weight>
        **/
-      setKeys: AugmentedSubmittable<(keys: Keys, proof: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Keys, Bytes]>;
+      setKeys: AugmentedSubmittable<(keys: Keys | string | Uint8Array, proof: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Keys, Bytes]>;
     };
     staking: {
       /**
@@ -2419,7 +2419,7 @@ declare module '@polkadot/api/types/submittable' {
        * - Write: Bonded, Payee, [Origin Account], Locks, Ledger
        * # </weight>
        **/
-      bond: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, RewardDestination]>;
+      bond: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, RewardDestination]>;
       /**
        * Add some extra amount that have appeared in the stash `free_balance` into the balance up
        * for staking.
@@ -2709,7 +2709,7 @@ declare module '@polkadot/api/types/submittable' {
        * - Write: Payee
        * # </weight>
        **/
-      setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [RewardDestination]>;
+      setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [RewardDestination]>;
       /**
        * Sets the ideal number of validators.
        * 

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


+ 18 - 9
types/augment/all/defs.json

@@ -112,17 +112,19 @@
         "sticky_thread_ids": "Vec<ThreadId>"
     },
     "Thread": {
-        "title_hash": "Hash",
+        "metadata_hash": "Hash",
         "category_id": "CategoryId",
         "author_id": "ForumUserId",
-        "archived": "bool",
         "poll": "Option<Poll>",
-        "num_direct_posts": "u32"
+        "cleanup_pay_off": "u128",
+        "number_of_posts": "u64"
     },
     "Post": {
         "thread_id": "ThreadId",
         "text_hash": "Hash",
-        "author_id": "ForumUserId"
+        "author_id": "ForumUserId",
+        "cleanup_pay_off": "u128",
+        "last_edited": "u32"
     },
     "PollAlternative": {
         "alternative_text_hash": "Hash",
@@ -145,12 +147,17 @@
         "poll_alternatives": "Vec<Bytes>"
     },
     "ThreadOf": {
-        "title_hash": "Hash",
+        "metadata_hash": "Hash",
         "category_id": "CategoryId",
         "author_id": "ForumUserId",
-        "archived": "bool",
         "poll": "Option<Poll>",
-        "num_direct_posts": "u32"
+        "cleanup_pay_off": "u128",
+        "number_of_posts": "u64"
+    },
+    "ExtendedPostId": {
+        "category_id": "CategoryId",
+        "thread_id": "ThreadId",
+        "post_id": "PostId"
     },
     "ApplicationId": "u64",
     "Application": {
@@ -188,7 +195,8 @@
         "created": "u32",
         "description_hash": "Bytes",
         "stake_policy": "StakePolicy",
-        "reward_per_block": "Option<u128>"
+        "reward_per_block": "Option<u128>",
+        "creation_stake": "u128"
     },
     "OpeningId": "u64",
     "StakePolicy": {
@@ -687,5 +695,6 @@
         }
     },
     "MaxNumber": "u32",
-    "IsCensored": "bool"
+    "IsCensored": "bool",
+    "AccountInfo": "AccountInfoWithRefCount"
 }

+ 20 - 6
types/augment/all/types.ts

@@ -4,6 +4,10 @@
 import type { BTreeMap, BTreeSet, Bytes, Enum, Option, Struct, Text, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types';
 import type { ITuple } from '@polkadot/types/types';
 import type { AccountId, Balance, Hash } from '@polkadot/types/interfaces/runtime';
+import type { AccountInfoWithRefCount } from '@polkadot/types/interfaces/system';
+
+/** @name AccountInfo */
+export interface AccountInfo extends AccountInfoWithRefCount {}
 
 /** @name ActorId */
 export interface ActorId extends u64 {}
@@ -357,6 +361,13 @@ export interface ExecutionStatus extends Enum {
   readonly asExecutionFailed: ExecutionFailed;
 }
 
+/** @name ExtendedPostId */
+export interface ExtendedPostId extends Struct {
+  readonly category_id: CategoryId;
+  readonly thread_id: ThreadId;
+  readonly post_id: PostId;
+}
+
 /** @name FillOpeningParameters */
 export interface FillOpeningParameters extends Struct {
   readonly opening_id: OpeningId;
@@ -478,6 +489,7 @@ export interface Opening extends Struct {
   readonly description_hash: Bytes;
   readonly stake_policy: StakePolicy;
   readonly reward_per_block: Option<u128>;
+  readonly creation_stake: u128;
 }
 
 /** @name OpeningId */
@@ -594,6 +606,8 @@ export interface Post extends Struct {
   readonly thread_id: ThreadId;
   readonly text_hash: Hash;
   readonly author_id: ForumUserId;
+  readonly cleanup_pay_off: u128;
+  readonly last_edited: u32;
 }
 
 /** @name PostId */
@@ -885,12 +899,12 @@ export interface TerminateRoleParameters extends Struct {
 
 /** @name Thread */
 export interface Thread extends Struct {
-  readonly title_hash: Hash;
+  readonly metadata_hash: Hash;
   readonly category_id: CategoryId;
   readonly author_id: ForumUserId;
-  readonly archived: bool;
   readonly poll: Option<Poll>;
-  readonly num_direct_posts: u32;
+  readonly cleanup_pay_off: u128;
+  readonly number_of_posts: u64;
 }
 
 /** @name ThreadId */
@@ -905,12 +919,12 @@ export interface ThreadMode extends Enum {
 
 /** @name ThreadOf */
 export interface ThreadOf extends Struct {
-  readonly title_hash: Hash;
+  readonly metadata_hash: Hash;
   readonly category_id: CategoryId;
   readonly author_id: ForumUserId;
-  readonly archived: bool;
   readonly poll: Option<Poll>;
-  readonly num_direct_posts: u32;
+  readonly cleanup_pay_off: u128;
+  readonly number_of_posts: u64;
 }
 
 /** @name Title */

+ 2 - 3
types/augment/augment-api-events.ts

@@ -2,8 +2,7 @@
 /* eslint-disable */
 
 import type { BTreeMap, BTreeSet, Bytes, Option, Text, Vec, bool, u32, u64, u8 } from '@polkadot/types';
-import type { ITuple } from '@polkadot/types/types';
-import type { ActorId, ApplicationId, ApplicationIdToWorkerIdMap, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, Channel, ChannelCategory, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentActor, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, EntryId, ExecutionStatus, ForumUserId, GeneralProposalParameters, InviteMembershipParameters, IsCensored, MemberId, MemoText, ModeratorId, NewAsset, OpeningId, OpeningType, OptionResult, OracleJudgment, ParticipantId, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PollInput, PostId, PostReactionId, PrivilegedActor, ProposalDecision, ProposalDetailsOf, ProposalId, ProposalStatus, ReplyId, RewardPaymentType, Series, SeriesId, SeriesParameters, StakePolicy, StorageObjectOwner, StorageProviderId, ThreadId, ThreadMode, Title, UpdatedBody, UpdatedTitle, UploadingStatus, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, VoucherLimit, WorkerId, WorkingGroup } from './all';
+import type { ActorId, ApplicationId, ApplicationIdToWorkerIdMap, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, Channel, ChannelCategory, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentActor, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, EntryId, ExecutionStatus, ExtendedPostId, ForumUserId, GeneralProposalParameters, InviteMembershipParameters, IsCensored, MemberId, MemoText, ModeratorId, NewAsset, OpeningId, OpeningType, OptionResult, OracleJudgment, ParticipantId, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PollInput, PostId, PostReactionId, PrivilegedActor, ProposalDecision, ProposalDetailsOf, ProposalId, ProposalStatus, ReplyId, RewardPaymentType, Series, SeriesId, SeriesParameters, StakePolicy, StorageObjectOwner, StorageProviderId, ThreadId, ThreadMode, Title, UpdatedBody, UpdatedTitle, UploadingStatus, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, VoucherLimit, WorkerId, WorkingGroup } from './all';
 import type { BalanceStatus } from '@polkadot/types/interfaces/balances';
 import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
 import type { AuthorityList } from '@polkadot/types/interfaces/grandpa';
@@ -622,7 +621,7 @@ declare module '@polkadot/api/types/events' {
       /**
        * Post with givne id was deleted.
        **/
-      PostDeleted: AugmentedEvent<ApiType, [Bytes, ForumUserId, BTreeMap<ITuple<[CategoryId, ThreadId, PostId]>, bool>]>;
+      PostDeleted: AugmentedEvent<ApiType, [Bytes, ForumUserId, BTreeMap<ExtendedPostId, bool>]>;
       /**
        * Post with givne id was moderated.
        **/

+ 16 - 16
types/augment/augment-api-query.ts

@@ -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 | AnyNumber | Uint8Array) => Observable<Reply>, [PostId, ReplyId]>;
+      replyById: AugmentedQuery<ApiType, (arg1: PostId | AnyNumber | Uint8Array, arg2: ReplyId | AnyNumber | Uint8Array) => Observable<Reply>, [PostId, ReplyId]>;
     };
     bounty: {
       /**
@@ -150,7 +150,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Double map for bounty funding. It stores a member or council funding for bounties.
        **/
-      bountyContributions: AugmentedQueryDoubleMap<ApiType, (key1: BountyId | AnyNumber | Uint8Array, key2: BountyActor | { Council: any } | { Member: any } | string | Uint8Array) => Observable<BalanceOf>, [BountyId, BountyActor]>;
+      bountyContributions: AugmentedQuery<ApiType, (arg1: BountyId | AnyNumber | Uint8Array, arg2: BountyActor | { Council: any } | { Member: any } | string | Uint8Array) => Observable<BalanceOf>, [BountyId, BountyActor]>;
       /**
        * Count of all bounties that have been created.
        **/
@@ -349,7 +349,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Moderator set for each Category
        **/
-      categoryByModerator: AugmentedQueryDoubleMap<ApiType, (key1: CategoryId | AnyNumber | Uint8Array, key2: ModeratorId | AnyNumber | Uint8Array) => Observable<ITuple<[]>>, [CategoryId, ModeratorId]>;
+      categoryByModerator: AugmentedQuery<ApiType, (arg1: CategoryId | AnyNumber | Uint8Array, arg2: ModeratorId | AnyNumber | Uint8Array) => Observable<ITuple<[]>>, [CategoryId, ModeratorId]>;
       /**
        * Counter for all existing categories.
        **/
@@ -373,15 +373,15 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Unique thread poll voters. This private double map prevents double voting.
        **/
-      pollVotes: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: ForumUserId | AnyNumber | Uint8Array) => Observable<bool>, [ThreadId, ForumUserId]>;
+      pollVotes: AugmentedQuery<ApiType, (arg1: ThreadId | AnyNumber | Uint8Array, arg2: ForumUserId | AnyNumber | Uint8Array) => Observable<bool>, [ThreadId, ForumUserId]>;
       /**
        * Map post identifier to corresponding post.
        **/
-      postById: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: PostId | AnyNumber | Uint8Array) => Observable<Post>, [ThreadId, PostId]>;
+      postById: AugmentedQuery<ApiType, (arg1: ThreadId | AnyNumber | Uint8Array, arg2: PostId | AnyNumber | Uint8Array) => Observable<Post>, [ThreadId, PostId]>;
       /**
        * Map thread identifier to corresponding thread.
        **/
-      threadById: AugmentedQueryDoubleMap<ApiType, (key1: CategoryId | AnyNumber | Uint8Array, key2: ThreadId | AnyNumber | Uint8Array) => Observable<ThreadOf>, [CategoryId, ThreadId]>;
+      threadById: AugmentedQuery<ApiType, (arg1: CategoryId | AnyNumber | Uint8Array, arg2: ThreadId | AnyNumber | Uint8Array) => Observable<ThreadOf>, [CategoryId, ThreadId]>;
     };
     forumWorkingGroup: {
       /**
@@ -518,7 +518,7 @@ declare module '@polkadot/api/types/storage' {
        * For each session index, we keep a mapping of `T::ValidatorId` to the
        * number of blocks authored by the given authority.
        **/
-      authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>, [SessionIndex, ValidatorId]>;
+      authoredBlocks: AugmentedQuery<ApiType, (arg1: SessionIndex | AnyNumber | Uint8Array, arg2: ValidatorId | string | Uint8Array) => Observable<u32>, [SessionIndex, ValidatorId]>;
       /**
        * The block number after which it's ok to send heartbeats in current session.
        * 
@@ -536,7 +536,7 @@ declare module '@polkadot/api/types/storage' {
        * For each session index, we keep a mapping of `AuthIndex` to
        * `offchain::OpaqueNetworkState`.
        **/
-      receivedHeartbeats: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: AuthIndex | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [SessionIndex, AuthIndex]>;
+      receivedHeartbeats: AugmentedQuery<ApiType, (arg1: SessionIndex | AnyNumber | Uint8Array, arg2: AuthIndex | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [SessionIndex, AuthIndex]>;
     };
     members: {
       /**
@@ -631,7 +631,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * A vector of reports of the same kind that happened at the same time slot.
        **/
-      concurrentReportsIndex: AugmentedQueryDoubleMap<ApiType, (key1: Kind | string | Uint8Array, key2: OpaqueTimeSlot | string | Uint8Array) => Observable<Vec<ReportIdOf>>, [Kind, OpaqueTimeSlot]>;
+      concurrentReportsIndex: AugmentedQuery<ApiType, (arg1: Kind | string | Uint8Array, arg2: OpaqueTimeSlot | string | Uint8Array) => Observable<Vec<ReportIdOf>>, [Kind, OpaqueTimeSlot]>;
       /**
        * Deferred reports that have been rejected by the offence handler and need to be submitted
        * at a later time.
@@ -715,7 +715,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Map thread id and post id to corresponding post.
        **/
-      postThreadIdByPostId: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: PostId | AnyNumber | Uint8Array) => Observable<DiscussionPost>, [ThreadId, PostId]>;
+      postThreadIdByPostId: AugmentedQuery<ApiType, (arg1: ThreadId | AnyNumber | Uint8Array, arg2: PostId | AnyNumber | Uint8Array) => Observable<DiscussionPost>, [ThreadId, PostId]>;
       /**
        * Map thread identifier to corresponding thread.
        **/
@@ -745,7 +745,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Double map for preventing duplicate votes. Should be cleaned after usage.
        **/
-      voteExistsByProposalByVoter: AugmentedQueryDoubleMap<ApiType, (key1: ProposalId | AnyNumber | Uint8Array, key2: MemberId | AnyNumber | Uint8Array) => Observable<VoteKind>, [ProposalId, MemberId]>;
+      voteExistsByProposalByVoter: AugmentedQuery<ApiType, (arg1: ProposalId | AnyNumber | Uint8Array, arg2: MemberId | AnyNumber | Uint8Array) => Observable<VoteKind>, [ProposalId, MemberId]>;
     };
     randomnessCollectiveFlip: {
       /**
@@ -857,7 +857,7 @@ declare module '@polkadot/api/types/storage' {
        * 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>, [EraIndex, AccountId]>;
+      erasStakers: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<Exposure>, [EraIndex, AccountId]>;
       /**
        * Clipped Exposure of validator at era.
        * 
@@ -871,7 +871,7 @@ declare module '@polkadot/api/types/storage' {
        * Is it removed after `HISTORY_DEPTH` eras.
        * If stakers hasn't been set or has been removed then empty exposure is returned.
        **/
-      erasStakersClipped: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Exposure>, [EraIndex, AccountId]>;
+      erasStakersClipped: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<Exposure>, [EraIndex, AccountId]>;
       /**
        * The session index at which the era start for the last `HISTORY_DEPTH` eras.
        **/
@@ -888,7 +888,7 @@ declare module '@polkadot/api/types/storage' {
        * 
        * Is it removed after `HISTORY_DEPTH` eras.
        **/
-      erasValidatorPrefs: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>, [EraIndex, AccountId]>;
+      erasValidatorPrefs: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>, [EraIndex, AccountId]>;
       /**
        * The total validator era payout for the last `HISTORY_DEPTH` eras.
        * 
@@ -935,7 +935,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * All slashing events on nominators, mapped by era to the highest slash value of the era.
        **/
-      nominatorSlashInEra: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Option<BalanceOf>>, [EraIndex, AccountId]>;
+      nominatorSlashInEra: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<Option<BalanceOf>>, [EraIndex, AccountId]>;
       /**
        * Where the reward payment should be made. Keyed by stash.
        **/
@@ -998,7 +998,7 @@ declare module '@polkadot/api/types/storage' {
        * All slashing events on validators, mapped by era to the highest slash proportion
        * and slash value of the era.
        **/
-      validatorSlashInEra: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Option<ITuple<[Perbill, BalanceOf]>>>, [EraIndex, AccountId]>;
+      validatorSlashInEra: AugmentedQuery<ApiType, (arg1: EraIndex | AnyNumber | Uint8Array, arg2: AccountId | string | Uint8Array) => Observable<Option<ITuple<[Perbill, BalanceOf]>>>, [EraIndex, AccountId]>;
     };
     storageWorkingGroup: {
       /**

+ 31 - 5
types/augment/augment-api-rpc.ts

@@ -1,15 +1,15 @@
 // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
 /* eslint-disable */
 
-import type { Metadata } from '@polkadot/metadata';
-import type { Bytes, HashMap, Json, Null, Option, StorageKey, Text, U256, U64, Vec, bool, u32, u64 } from '@polkadot/types';
+import type { Bytes, HashMap, Json, Metadata, Null, Option, StorageKey, Text, U256, U64, Vec, bool, u32, u64 } from '@polkadot/types';
 import type { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types';
 import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
 import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
+import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
 import type { BlockHash } from '@polkadot/types/interfaces/chain';
 import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
 import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
-import type { ContractCallRequest, ContractExecResult } from '@polkadot/types/interfaces/contracts';
+import type { ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
 import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
 import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
 import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
@@ -19,7 +19,7 @@ import type { StorageKind } from '@polkadot/types/interfaces/offchain';
 import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
 import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
 import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
-import type { ReadProof, RuntimeVersion } from '@polkadot/types/interfaces/state';
+import type { ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
 import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';
 
 declare module '@polkadot/rpc-core/types.jsonrpc' {
@@ -64,6 +64,12 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        **/
       epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;
     };
+    beefy: {
+      /**
+       * Returns the block most recently finalized by BEEFY, alongside side its justification.
+       **/
+      subscribeJustifications: AugmentedRpc<() => Observable<BeefySignedCommitment>>;
+    };
     chain: {
       /**
        * Get header and body of a relay chain block
@@ -99,6 +105,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Returns the keys with prefix from a child storage, leave empty to get all the keys
        **/
       getKeys: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
+      /**
+       * Returns the keys with prefix from a child storage with pagination support
+       **/
+      getKeysPaged: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, count: u32 | AnyNumber | Uint8Array, startKey?: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
       /**
        * Returns a child storage entry at a specific block state
        **/
@@ -121,6 +131,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Returns the value under a specified storage key in a contract
        **/
       getStorage: AugmentedRpc<(address: AccountId | string | Uint8Array, key: H256 | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<Bytes>>>;
+      /**
+       * Instantiate a new contract
+       **/
+      instantiate: AugmentedRpc<(request: InstantiateRequest | { origin?: any; endowment?: any; gasLimit?: any; code?: any; data?: any; salt?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ContractInstantiateResult>>;
       /**
        * Returns the projected time a given contract will be able to sustain paying its rent
        **/
@@ -142,7 +156,7 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        **/
       accounts: AugmentedRpc<() => Observable<Vec<H160>>>;
       /**
-       * Returns balance of the given account.
+       * Returns the blockNumber
        **/
       blockNumber: AugmentedRpc<() => Observable<U256>>;
       /**
@@ -371,6 +385,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Retrieves the keys with prefix of a specific child storage
        **/
       getChildKeys: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
+      /**
+       * Returns proof of storage for child key entries at a specific block state.
+       **/
+      getChildReadProof: AugmentedRpc<(childStorageKey: PrefixedStorageKey | string | Uint8Array, keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: BlockHash | string | Uint8Array) => Observable<ReadProof>>;
       /**
        * Retrieves the child storage for a key
        **/
@@ -435,6 +453,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Subscribes to storage changes for the provided keys
        **/
       subscribeStorage: AugmentedRpc<<T = Codec[]>(keys?: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[]) => Observable<T>>;
+      /**
+       * Provides a way to trace the re-execution of a single block
+       **/
+      traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option<Text> | null | object | string | Uint8Array, storageKeys: Option<Text> | null | object | string | Uint8Array) => Observable<TraceBlockResponse>>;
     };
     syncstate: {
       /**
@@ -503,6 +525,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
        * Remove a reserved peer
        **/
       removeReservedPeer: AugmentedRpc<(peerId: Text | string) => Observable<Text>>;
+      /**
+       * Returns the list of reserved peers
+       **/
+      reservedPeers: AugmentedRpc<() => Observable<Vec<Text>>>;
       /**
        * Resets the log filter to Substrate defaults
        **/

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

@@ -2,8 +2,8 @@
 /* eslint-disable */
 
 import type { BTreeMap, BTreeSet, Bytes, Compact, Option, Vec, bool, u16, u32, u64, u8 } from '@polkadot/types';
-import type { AnyNumber, ITuple } from '@polkadot/types/types';
-import type { ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentActor, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, EntryId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InviteMembershipParameters, MemberId, MemoText, ModeratorId, ObjectOwner, OpeningId, OpeningType, OracleJudgment, ParticipantId, PersonActor, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PollInput, PostId, PostReactionId, PrivilegedActor, ProposalDetailsOf, ProposalId, ReplyId, ReplyToDelete, SeriesId, SeriesParameters, StakePolicy, StorageProviderId, ThreadId, ThreadMode, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, WorkerId, WorkingGroup } from './all';
+import type { AnyNumber } from '@polkadot/types/types';
+import type { ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentActor, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, EntryId, ExtendedPostId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InviteMembershipParameters, MemberId, MemoText, ModeratorId, ObjectOwner, OpeningId, OpeningType, OracleJudgment, ParticipantId, PersonActor, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PollInput, PostId, PostReactionId, PrivilegedActor, ProposalDetailsOf, ProposalId, ReplyId, ReplyToDelete, SeriesId, SeriesParameters, StakePolicy, StorageProviderId, ThreadId, ThreadMode, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, WorkerId, WorkingGroup } from './all';
 import type { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
 import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
@@ -891,7 +891,7 @@ declare module '@polkadot/api/types/submittable' {
        * - O(W + P)
        * # </weight>
        **/
-      deletePosts: AugmentedSubmittable<(forumUserId: ForumUserId | AnyNumber | Uint8Array, posts: BTreeMap<ITuple<[CategoryId, ThreadId, PostId]>, bool>, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [ForumUserId, BTreeMap<ITuple<[CategoryId, ThreadId, PostId]>, bool>, Bytes]>;
+      deletePosts: AugmentedSubmittable<(forumUserId: ForumUserId | AnyNumber | Uint8Array, posts: BTreeMap<ExtendedPostId, bool>, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [ForumUserId, BTreeMap<ExtendedPostId, bool>, Bytes]>;
       /**
        * Delete thread
        * 
@@ -2392,7 +2392,7 @@ declare module '@polkadot/api/types/submittable' {
        * - DbWrites per key id: `KeyOwner`
        * # </weight>
        **/
-      setKeys: AugmentedSubmittable<(keys: Keys, proof: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Keys, Bytes]>;
+      setKeys: AugmentedSubmittable<(keys: Keys | string | Uint8Array, proof: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Keys, Bytes]>;
     };
     staking: {
       /**
@@ -2419,7 +2419,7 @@ declare module '@polkadot/api/types/submittable' {
        * - Write: Bonded, Payee, [Origin Account], Locks, Ledger
        * # </weight>
        **/
-      bond: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, RewardDestination]>;
+      bond: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, RewardDestination]>;
       /**
        * Add some extra amount that have appeared in the stash `free_balance` into the balance up
        * for staking.
@@ -2709,7 +2709,7 @@ declare module '@polkadot/api/types/submittable' {
        * - Write: Payee
        * # </weight>
        **/
-      setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [RewardDestination]>;
+      setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [RewardDestination]>;
       /**
        * Sets the ideal number of validators.
        * 

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


+ 5 - 5
types/package.json

@@ -22,9 +22,9 @@
   "author": "Joystream contributors",
   "maintainers": [],
   "dependencies": {
-    "@polkadot/api": "4.2.1",
-    "@polkadot/types": "4.2.1",
-    "@polkadot/keyring": "^6.0.5",
+    "@polkadot/api": "5.3.2",
+    "@polkadot/types": "5.3.2",
+    "@polkadot/keyring": "^7.1.1",
     "@types/lodash": "^4.14.157",
     "@types/vfile": "^4.0.0",
     "ajv": "^6.11.0",
@@ -32,9 +32,9 @@
     "moment": "^2.24.0"
   },
   "devDependencies": {
-    "@polkadot/typegen": "4.2.1",
+    "@polkadot/typegen": "5.3.2",
     "ts-node": "^8.6.2",
-    "typescript": "^4.0.3",
+    "typescript": "^4.3.5",
     "madge": "^3.9.2",
     "json-schema-to-typescript": "^9.1.1"
   },

+ 3 - 3
types/src/bounty.ts

@@ -1,5 +1,5 @@
-import { Null, u32, u128, bool, Option } from '@polkadot/types'
-import { JoyEnum, JoyStructDecorated, JoyBTreeSet, MemberId, AccountId } from './common'
+import { Null, u32, u128, bool, Option, BTreeSet } from '@polkadot/types'
+import { JoyEnum, JoyStructDecorated, MemberId, AccountId } from './common'
 
 export class BountyId extends u32 {}
 export class EntryId extends u32 {}
@@ -11,7 +11,7 @@ export class BountyActor extends JoyEnum({
 
 export class AssuranceContractType extends JoyEnum({
   Open: Null,
-  Closed: JoyBTreeSet(MemberId),
+  Closed: BTreeSet.with(MemberId),
 }) {}
 
 export class FundingType_Perpetual extends JoyStructDecorated({

+ 2 - 63
types/src/common.ts

@@ -1,75 +1,14 @@
-import { Struct, Option, Text, bool, u16, u32, u64, Null, U8aFixed, BTreeSet, UInt, BTreeMap } from '@polkadot/types'
+import { Struct, Option, Text, bool, u16, u32, u64, Null, U8aFixed } from '@polkadot/types'
 import { BlockNumber, Hash as PolkadotHash, Moment } from '@polkadot/types/interfaces'
-import { Codec, Constructor, RegistryTypes } from '@polkadot/types/types'
+import { Codec, RegistryTypes } from '@polkadot/types/types'
 // we get 'moment' because it is a dependency of @polkadot/util, via @polkadot/keyring
 import moment from 'moment'
 import { JoyStructCustom, JoyStructDecorated } from './JoyStruct'
 import { JoyEnum } from './JoyEnum'
 import { GenericAccountId } from '@polkadot/types/generic/AccountId'
-import { AbstractArray } from '@polkadot/types/codec/AbstractArray'
-import { AbstractInt } from '@polkadot/types/codec/AbstractInt'
 
 export { JoyEnum, JoyStructCustom, JoyStructDecorated }
 
-// See: https://github.com/polkadot-js/api/issues/3636
-
-// Adds sorting during BTreeSet toU8a encoding (required by the runtime)
-// Currently only supports values that extend UInt
-// FIXME: Will not cover cases where BTreeSet is part of extrinsic args metadata
-export interface ExtendedBTreeSet<V extends UInt> extends BTreeSet<V> {
-  toArray(): V[]
-}
-
-export function JoyBTreeSet<V extends UInt>(valType: Constructor<V>): Constructor<ExtendedBTreeSet<V>> {
-  return class extends BTreeSet.with(valType) {
-    public forEach(callbackFn: (value: V, value2: V, set: Set<V>) => void, thisArg?: any): void {
-      const sorted = this.toArray()
-      return new Set(sorted).forEach(callbackFn, thisArg)
-    }
-
-    public toArray() {
-      return Array.from(this).sort((a, b) => (a.lt(b) ? -1 : 1))
-    }
-  }
-}
-
-export interface ExtendedBTreeMap<K extends Codec, V extends Codec> extends BTreeMap<K, V> {
-  toMap(): Map<K, V>
-}
-
-export function JoyBTreeMap<K extends Codec, V extends Codec>(
-  keyType: Constructor<K>,
-  valType: Constructor<V>
-): Constructor<ExtendedBTreeMap<K, V>> {
-  return class extends BTreeMap.with(keyType, valType) {
-    public forEach(callbackFn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {
-      const sorted = this.toMap()
-      return new Map(sorted).forEach(callbackFn, thisArg)
-    }
-
-    private sortFn([keyA]: [K, V], [keyB]: [K, V]) {
-      if (keyA instanceof AbstractArray) {
-        let sortRes = 0
-        for (const i in keyA) {
-          sortRes = this.sortFn(keyA[i], (keyB as typeof keyA)[i])
-          if (sortRes !== 0) {
-            return sortRes
-          }
-        }
-        return sortRes
-      } else if (keyA instanceof AbstractInt) {
-        return keyA.eq(keyB) ? 0 : keyA.lt(keyB as typeof keyA) ? -1 : 1
-      } else {
-        throw new Error(`JoyBTreeMap: Unsupported key type: ${keyA.toRawType()}`)
-      }
-    }
-
-    public toMap() {
-      return new Map<K, V>(Array.from(this.entries()).sort(this.sortFn.bind(this)))
-    }
-  }
-}
-
 export class ActorId extends u64 {}
 export class MemberId extends u64 {}
 export class Url extends Text {}

+ 3 - 3
types/src/content/index.ts

@@ -1,6 +1,6 @@
-import { Vec, Option, Tuple } from '@polkadot/types'
+import { Vec, Option, Tuple, BTreeSet } from '@polkadot/types'
 import { bool, u64, u32, u128, Null, Bytes } from '@polkadot/types/primitive'
-import { JoyStructDecorated, JoyEnum, ChannelId, JoyBTreeSet, DAOId, Url, MemberId, AccountId } from '../common'
+import { JoyStructDecorated, JoyEnum, ChannelId, DAOId, Url, MemberId, AccountId } from '../common'
 import { ContentParameters } from '../storage'
 
 export class CuratorId extends u64 {}
@@ -21,7 +21,7 @@ export class NewAsset extends JoyEnum({
 }) {}
 
 export class CuratorGroup extends JoyStructDecorated({
-  curators: JoyBTreeSet(CuratorId),
+  curators: BTreeSet.with(CuratorId),
   active: bool,
 }) {}
 

+ 15 - 10
types/src/forum.ts

@@ -1,7 +1,7 @@
-import { bool, u32, u64, Option, Vec, Null, Bytes, Tuple } from '@polkadot/types'
+import { bool, u32, u64, Option, Vec, Null, Bytes, BTreeMap, u128 } from '@polkadot/types'
 import { Moment } from '@polkadot/types/interfaces'
-import { Hash, ThreadId, PostId, JoyStructDecorated, JoyEnum, JoyBTreeMap } from './common'
-import { Constructor, ITuple, RegistryTypes } from '@polkadot/types/types'
+import { Hash, ThreadId, PostId, JoyStructDecorated, JoyEnum } from './common'
+import { RegistryTypes } from '@polkadot/types/types'
 
 export class ForumUserId extends u64 {}
 export class ModeratorId extends u64 {}
@@ -35,15 +35,17 @@ export class Post extends JoyStructDecorated({
   thread_id: ThreadId,
   text_hash: Hash,
   author_id: ForumUserId,
+  cleanup_pay_off: u128,
+  last_edited: u32,
 }) {}
 
 export class Thread extends JoyStructDecorated({
-  title_hash: Hash,
+  metadata_hash: Hash,
   category_id: CategoryId,
   author_id: ForumUserId,
-  archived: bool,
   poll: Option.with(Poll),
-  num_direct_posts: u32,
+  cleanup_pay_off: u128,
+  number_of_posts: u64,
 }) {}
 
 export class Category extends JoyStructDecorated({
@@ -68,11 +70,13 @@ export class PollInput extends JoyStructDecorated({
   poll_alternatives: Vec.with(Bytes),
 }) {}
 
-export class PostIdTuple extends ((Tuple.with([CategoryId, ThreadId, PostId]) as unknown) as Constructor<
-  ITuple<[CategoryId, ThreadId, PostId]>
->) {}
+export class ExtendedPostId extends JoyStructDecorated({
+  category_id: CategoryId,
+  thread_id: ThreadId,
+  post_id: PostId,
+}) {}
 
-export class PostsToDeleteMap extends JoyBTreeMap(PostIdTuple, bool) {}
+export class PostsToDeleteMap extends BTreeMap.with(ExtendedPostId, bool) {}
 
 export const forumTypes: RegistryTypes = {
   ForumUserId,
@@ -88,6 +92,7 @@ export const forumTypes: RegistryTypes = {
   PollInput,
   // runtime alias
   ThreadOf: Thread,
+  ExtendedPostId,
 }
 
 export default forumTypes

+ 2 - 0
types/src/index.ts

@@ -33,6 +33,8 @@ export const types: RegistryTypes = {
   ...constitution,
   ...bounty,
   ...content,
+  // https://github.com/polkadot-js/api/blob/master/CHANGELOG.md#351-jan-18-2020
+  AccountInfo: 'AccountInfoWithRefCount',
 }
 
 // Allows creating types without api instance (it's not a recommended way though, so should be used just for mocks)

+ 5 - 3
types/src/working-group/index.ts

@@ -1,7 +1,7 @@
-import { Bytes, BTreeMap, Option, Text } from '@polkadot/types'
+import { Bytes, BTreeMap, Option, Text, BTreeSet } from '@polkadot/types'
 import { Null, u32, u64, u128 } from '@polkadot/types/primitive'
 import { BlockNumber, Balance } from '@polkadot/types/interfaces'
-import { ActorId, MemberId, JoyEnum, JoyStructDecorated, JoyBTreeSet, AccountId } from '../common'
+import { ActorId, MemberId, JoyEnum, JoyStructDecorated, AccountId } from '../common'
 import { RegistryTypes } from '@polkadot/types/types'
 
 export class ApplicationId extends u64 {}
@@ -9,7 +9,7 @@ export class OpeningId extends u64 {}
 export class WorkerId extends ActorId {}
 export class StorageProviderId extends WorkerId {}
 
-export class ApplicationIdSet extends JoyBTreeSet(ApplicationId) {}
+export class ApplicationIdSet extends BTreeSet.with(ApplicationId) {}
 export class ApplicationIdToWorkerIdMap extends BTreeMap.with(ApplicationId, WorkerId) {}
 
 export type IApplication = {
@@ -157,6 +157,7 @@ export type IOpening = {
   description_hash: Bytes
   stake_policy: StakePolicy
   reward_per_block: Option<Balance>
+  creation_stake: Balance
 }
 
 export class Opening
@@ -166,6 +167,7 @@ export class Opening
     description_hash: Bytes,
     stake_policy: StakePolicy,
     reward_per_block: Option.with(u128),
+    creation_stake: u128,
   })
   implements IOpening {}
 

+ 7 - 7
utils/api-scripts/package.json

@@ -13,17 +13,17 @@
   },
   "dependencies": {
     "@joystream/types": "^0.17.0",
-    "@polkadot/api": "4.2.1",
-    "@polkadot/types": "4.2.1",
-    "@polkadot/keyring": "^6.0.5",
-    "@polkadot/util": "^6.0.5",
-    "@polkadot/util-crypto": "^6.0.5",
+    "@polkadot/api": "5.3.2",
+    "@polkadot/types": "5.3.2",
+    "@polkadot/keyring": "^7.1.1",
+    "@polkadot/util": "^7.1.1",
+    "@polkadot/util-crypto": "^7.1.1",
     "@types/bn.js": "^4.11.5",
     "bn.js": "^4.11.8"
   },
   "devDependencies": {
-    "@polkadot/ts": "^0.3.62",
-    "typescript": "^3.9.7",
+    "@polkadot/ts": "^0.4.4",
+    "typescript": "^4.3.5",
     "ts-node": "^8.6.2"
   },
   "volta": {

+ 3 - 2
utils/api-scripts/src/initialize-lead.ts

@@ -1,10 +1,11 @@
 import { registry, types } from '@joystream/types'
-import { JoyBTreeSet, MemberId } from '@joystream/types/common'
+import { MemberId } from '@joystream/types/common'
 import { ApplicationId, OpeningId } from '@joystream/types/working-group'
 import { ApiPromise, WsProvider } from '@polkadot/api'
 import { SubmittableExtrinsic } from '@polkadot/api/types'
 import { ExtrinsicsHelper, getAlicePair, getKeyFromSuri } from './helpers/extrinsics'
 import BN from 'bn.js'
+import { BTreeSet } from '@polkadot/types'
 
 const workingGroupModules = [
   'storageWorkingGroup',
@@ -138,7 +139,7 @@ async function main() {
     console.log('Filling the opening...')
     await txHelper.sendAndCheck(
       LeadKeyPair,
-      [sudo(api.tx[groupModule].fillOpening(openingId, new (JoyBTreeSet(ApplicationId))(registry, [applicationId])))],
+      [sudo(api.tx[groupModule].fillOpening(openingId, new (BTreeSet.with(ApplicationId))(registry, [applicationId])))],
       'Failed to fill the opening'
     )
   }

+ 3 - 2
utils/api-scripts/src/initialize-worker.ts

@@ -1,9 +1,10 @@
 import { registry, types } from '@joystream/types'
-import { JoyBTreeSet, MemberId } from '@joystream/types/common'
+import { MemberId } from '@joystream/types/common'
 import { ApplicationId, OpeningId } from '@joystream/types/working-group'
 import { ApiPromise, WsProvider } from '@polkadot/api'
 import { ExtrinsicsHelper, getAlicePair, getKeyFromSuri } from './helpers/extrinsics'
 import BN from 'bn.js'
+import { BTreeSet } from '@polkadot/types'
 
 const workingGroupModules = [
   'storageWorkingGroup',
@@ -144,7 +145,7 @@ async function main() {
   console.log('Filling the opening...')
   await txHelper.sendAndCheck(
     LeadRoleKeyPair,
-    [api.tx[groupModule].fillOpening(openingId, new (JoyBTreeSet(ApplicationId))(registry, [applicationId]))],
+    [api.tx[groupModule].fillOpening(openingId, new (BTreeSet.with(ApplicationId))(registry, [applicationId]))],
     'Failed to fill the opening'
   )
 

File diff suppressed because it is too large
+ 91 - 604
yarn.lock


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