Browse Source

Merge cli_channels

iorveth 4 years ago
parent
commit
2db722db9f
39 changed files with 1097 additions and 705 deletions
  1. 2 2
      Cargo.lock
  2. 0 1
      cli/examples/content/CreateChannel.json
  3. 0 1
      cli/examples/content/UpdateChannel.json
  4. 0 1
      cli/examples/content/createVideo.json
  5. 0 1
      cli/examples/content/updateVideo.json
  6. 6 6
      cli/src/Api.ts
  7. 24 24
      cli/src/Types.ts
  8. 7 36
      cli/src/base/ContentDirectoryCommandBase.ts
  9. 5 5
      cli/src/commands/content/channel.ts
  10. 2 2
      cli/src/commands/content/channels.ts
  11. 8 5
      cli/src/commands/content/createChannel.ts
  12. 7 4
      cli/src/commands/content/createVideo.ts
  13. 7 5
      cli/src/commands/content/updateChannel.ts
  14. 7 4
      cli/src/commands/content/updateVideo.ts
  15. 6 6
      cli/src/commands/content/videos.ts
  16. 12 13
      cli/src/helpers/InputOutput.ts
  17. 1 1
      cli/src/helpers/JsonSchemaPrompt.ts
  18. 71 54
      cli/src/helpers/serialization.ts
  19. 1 1
      content-metadata-protobuf/compiled/proto/Channel_pb.d.ts
  20. 211 141
      content-metadata-protobuf/compiled/proto/Channel_pb.js
  21. 89 37
      content-metadata-protobuf/compiled/proto/Person_pb.js
  22. 47 20
      content-metadata-protobuf/compiled/proto/Playlist_pb.js
  23. 154 76
      content-metadata-protobuf/compiled/proto/Series_pb.js
  24. 360 178
      content-metadata-protobuf/compiled/proto/Video_pb.js
  25. 0 2
      content-metadata-protobuf/proto/Channel.proto
  26. 1 1
      node/Cargo.toml
  27. 4 4
      pioneer/packages/joy-proposals/src/validationSchema.ts
  28. 2 2
      runtime-modules/proposals/codex/src/lib.rs
  29. 1 1
      runtime-modules/proposals/codex/src/proposal_types/mod.rs
  30. 3 3
      runtime-modules/proposals/codex/src/proposal_types/parameters.rs
  31. 8 8
      runtime-modules/proposals/codex/src/tests/mod.rs
  32. 1 1
      runtime/Cargo.toml
  33. 1 1
      runtime/src/constants.rs
  34. 2 2
      runtime/src/lib.rs
  35. 4 4
      runtime/src/tests/proposals_integration/mod.rs
  36. 4 0
      testnets/joy-testnet-4.json
  37. 16 12
      tests/network-tests/src/fixtures/proposalsModule.ts
  38. 3 4
      tests/network-tests/src/flows/proposals/validatorCountProposal.ts
  39. 20 36
      yarn.lock

+ 2 - 2
Cargo.lock

@@ -1993,7 +1993,7 @@ dependencies = [
 
 [[package]]
 name = "joystream-node"
-version = "3.7.1"
+version = "3.7.2"
 dependencies = [
  "frame-benchmarking",
  "frame-benchmarking-cli",
@@ -2053,7 +2053,7 @@ dependencies = [
 
 [[package]]
 name = "joystream-node-runtime"
-version = "7.14.0"
+version = "7.15.0"
 dependencies = [
  "frame-benchmarking",
  "frame-executive",

+ 0 - 1
cli/examples/content/CreateChannel.json

@@ -14,4 +14,3 @@
     "category": 1
   }
 }
-

+ 0 - 1
cli/examples/content/UpdateChannel.json

@@ -14,4 +14,3 @@
     "category": 1
   }
 }
-

+ 0 - 1
cli/examples/content/createVideo.json

@@ -34,4 +34,3 @@
     }
   }
 }
-

+ 0 - 1
cli/examples/content/updateVideo.json

@@ -34,4 +34,3 @@
     }
   }
 }
-

+ 6 - 6
cli/src/Api.ts

@@ -48,9 +48,9 @@ import { RewardRelationship, RewardRelationshipId } from '@joystream/types/recur
 import { Stake, StakeId } from '@joystream/types/stake'
 
 import { InputValidationLengthConstraint, ChannelId, Url } from '@joystream/types/common'
-import {  CuratorGroup, CuratorGroupId, Channel, Video, VideoId } from '@joystream/types/content'
-import { DataObject } from '@joystream/types/storage'
-import { ServiceProviderRecord,  } from '@joystream/types/discovery'
+import { CuratorGroup, CuratorGroupId, Channel, Video, VideoId } from '@joystream/types/content'
+import { ContentId, DataObject } from '@joystream/types/storage'
+import { ServiceProviderRecord } from '@joystream/types/discovery'
 import _ from 'lodash'
 
 export const DEFAULT_API_URI = 'ws://localhost:9944/'
@@ -530,9 +530,9 @@ export default class Api {
     return exists ? await this._api.query.content.videoById<Video>(videoId) : null
   }
 
-  async dataByContentId(contentId: number): Promise<DataObject | null> {
-    const dataObject = await this._api.query.dataDirectory.dataByContentId<Option<DataObject>>(contentId)
-    return dataObject.unwrapOr(null)
+  async dataByContentId(contentId: ContentId): Promise<DataObject | null> {
+    const dataObject = await this._api.query.dataDirectory.dataByContentId<DataObject>(contentId)
+    return dataObject.isEmpty ? null : dataObject
   }
 
   async ipnsIdentity(storageProviderId: number): Promise<string | null> {

+ 24 - 24
cli/src/Types.ts

@@ -1,6 +1,6 @@
 import BN from 'bn.js'
 import { ElectionStage, Seat } from '@joystream/types/council'
-import { Vec, Option} from '@polkadot/types';
+import { Vec, Option } from '@polkadot/types'
 import { Codec } from '@polkadot/types/types'
 import { BlockNumber, Balance, AccountId } from '@polkadot/types/interfaces'
 import { DeriveBalancesAll } from '@polkadot/api-derive/types'
@@ -9,8 +9,8 @@ import { WorkerId, OpeningType } from '@joystream/types/working-group'
 import { Membership, MemberId } from '@joystream/types/members'
 import { Opening, StakingPolicy, ApplicationStageKeys } from '@joystream/types/hiring'
 import { Validator } from 'inquirer'
-import { NewAsset} from '@joystream/types/content'
-import { Bytes } from '@polkadot/types/primitive';
+import { NewAsset } from '@joystream/types/content'
+import { Bytes } from '@polkadot/types/primitive'
 import { VideoMetadata, ChannelMetadata } from '@joystream/content-metadata-protobuf'
 
 // KeyringPair type extended with mandatory "meta.name"
@@ -202,45 +202,45 @@ export type ApiMethodNamedArg = {
 export type ApiMethodNamedArgs = ApiMethodNamedArg[]
 
 export type VideoUpdateParametersInput = {
-  assets: Option<Vec<NewAsset>>,
-  meta: VideoMetadata.AsObject,
+  assets: Option<Vec<NewAsset>>
+  meta: VideoMetadata.AsObject
 }
 
 export type VideoUpdateParameters = {
-  assets: Option<Vec<NewAsset>>,
-  meta: Bytes,
+  assets: Option<Vec<NewAsset>>
+  meta: Bytes
 }
 
 export type VideoCreationParametersInput = {
-  assets: Vec<NewAsset>,
-  meta: VideoMetadata.AsObject,
+  assets: Vec<NewAsset>
+  meta: VideoMetadata.AsObject
 }
 
 export type VideoCreationParameters = {
-  assets: Vec<NewAsset>,
-  meta: Bytes,
+  assets: Vec<NewAsset>
+  meta: Bytes
 }
 
 export type ChannelCreationParametersInput = {
-  assets: Vec<NewAsset>,
-  meta: ChannelMetadata.AsObject,
-  reward_account: Option<AccountId>,
+  assets: Vec<NewAsset>
+  meta: ChannelMetadata.AsObject
+  reward_account: Option<AccountId>
 }
 
 export type ChannelCreationParameters = {
-  assets: Vec<NewAsset>,
-  meta: Bytes,
-  reward_account: Option<AccountId>,
+  assets: Vec<NewAsset>
+  meta: Bytes
+  reward_account: Option<AccountId>
 }
 
 export type ChannelUpdateParametersInput = {
-  assets: Option<Vec<NewAsset>>,
-  meta: ChannelMetadata.AsObject,
-  reward_account: Option<AccountId>,
+  assets: Option<Vec<NewAsset>>
+  meta: ChannelMetadata.AsObject
+  reward_account: Option<AccountId>
 }
 
 export type ChannelUpdateParameters = {
-  assets: Option<Vec<NewAsset>>,
-  new_meta: Bytes,
-  reward_account: Option<AccountId>,
-}
+  assets: Option<Vec<NewAsset>>
+  new_meta: Bytes
+  reward_account: Option<AccountId>
+}

+ 7 - 36
cli/src/base/ContentDirectoryCommandBase.ts

@@ -1,12 +1,6 @@
 import ExitCodes from '../ExitCodes'
 import { WorkingGroups } from '../Types'
-import {
-  Channel,
-  CuratorGroup,
-  CuratorGroupId,
-  ContentActor,
-} from '@joystream/types/content'
-import { ChannelId } from '@joystream/types/common'
+import { Channel, CuratorGroup, CuratorGroupId, ContentActor } from '@joystream/types/content'
 import { Worker } from '@joystream/types/working-group'
 import { CLIError } from '@oclif/errors'
 import _ from 'lodash'
@@ -50,17 +44,13 @@ export default abstract class ContentDirectoryCommandBase extends RolesCommandBa
     const availableGroupIds = groups
       .filter(
         ([_, group]) =>
-          group.active.valueOf() &&
-          group.curators.toArray().some((curatorId) => curatorId.eq(curator.workerId))
+          group.active.valueOf() && group.curators.toArray().some((curatorId) => curatorId.eq(curator.workerId))
       )
       .map(([id]) => id)
 
     let groupId: number
     if (!availableGroupIds.length) {
-      this.error(
-        'You do not have the curator access!',
-        { exit: ExitCodes.AccessDenied }
-      )
+      this.error('You do not have the curator access!', { exit: ExitCodes.AccessDenied })
     } else if (availableGroupIds.length === 1) {
       groupId = availableGroupIds[0].toNumber()
     } else {
@@ -71,37 +61,18 @@ export default abstract class ContentDirectoryCommandBase extends RolesCommandBa
   }
 
   async promptForChannel(message = 'Select a channel'): Promise<Channel> {
-    const classes = await this.getApi().availableChannels()
-    const choices = classes.map(([id, c]) => ({ id: id.toString(), value: c }))
+    const channels = await this.getApi().availableChannels()
+    const choices = channels.map(([id, c]) => ({ id: id.toString(), value: c }))
     if (!choices.length) {
       this.warn('No channels exist to choose from!')
       this.exit(ExitCodes.InvalidInput)
     }
 
-    const selectedClass = await this.simplePrompt({ message, type: 'list', choices })
+    const selectedChannel = await this.simplePrompt({ message, type: 'list', choices })
 
-    return selectedClass
+    return selectedChannel
   }
 
-  // async channelEntryById(channelId: number): Promise<[ChannelId, Channel]> {
-  //   const foundChannel = await this.getApi().channelById(channelId)
-  //   if (!foundChannel) {
-  //     this.error(`Channel not found by channel id: "${channelId}"!`)
-  //   }
-
-  //   return [channelId, foundChannel]
-  // }
-
-  // async videoEntryById(videoId: string): Promise<[ChannelId, Channel]> {
-  //   const videos = await this.getApi().availableVideos()
-  //   const foundVideo = channels.find(([id, ]) => id.toString() === channelId)
-  //   if (!foundChannel) {
-  //     this.error(`Channel not found by channel id: "${channelId}"!`)
-  //   }
-
-  //   return foundChannel
-  // }
-
   private async curatorGroupChoices(ids?: CuratorGroupId[]) {
     const groups = await this.getApi().availableCuratorGroups()
     return groups

+ 5 - 5
cli/src/commands/content/channel.ts

@@ -19,19 +19,19 @@ export default class ChannelCommand extends ContentDirectoryCommandBase {
         'ID': channelId.toString(),
         'Owner': JSON.stringify(aChannel.owner.toJSON()),
         'IsCensored': aChannel.is_censored.toString(),
-        'RewardAccount': aChannel.reward_account? aChannel.reward_account.toString() : 'NONE'
+        'RewardAccount': aChannel.reward_account ? aChannel.reward_account.toString() : 'NONE',
       })
-  
+
       displayHeader(`Media`)
-  
+
       displayCollapsedRow({
         'NumberOfVideos': aChannel.videos.length,
         'NumberOfPlaylists': aChannel.playlists.length,
         'NumberOfSeries': aChannel.series.length,
       })
-  
+
       displayHeader(`MediaData`)
-  
+
       displayCollapsedRow({
         'Videos': JSON.stringify(aChannel.videos.toJSON()),
         'Playlists': JSON.stringify(aChannel.playlists.toJSON()),

+ 2 - 2
cli/src/commands/content/channels.ts

@@ -14,12 +14,12 @@ export default class ChannelsCommand extends ContentDirectoryCommandBase {
           'ID': id.toString(),
           'Owner': JSON.stringify(c.owner.toJSON()),
           'IsCensored': c.is_censored.toString(),
-          'RewardAccount': c.reward_account? c.reward_account.toString() : 'NONE'
+          'RewardAccount': c.reward_account ? c.reward_account.toString() : 'NONE',
         })),
         3
       )
     } else {
-        this.log('There are no channels yet')
+      this.log('There are no channels yet')
     }
   }
 }

+ 8 - 5
cli/src/commands/content/createChannel.ts

@@ -24,9 +24,9 @@ export default class CreateChannelCommand extends ContentDirectoryCommandBase {
 
     if (input) {
       let channelCreationParametersInput = await getInputJson<ChannelCreationParametersInput>(input)
-  
+
       const api = await this.getOriginalApi()
-      
+
       const meta = channelMetadataFromInput(api, channelCreationParametersInput)
 
       let channelCreationParameters: ChannelCreationParameters = {
@@ -38,12 +38,15 @@ export default class CreateChannelCommand extends ContentDirectoryCommandBase {
       this.jsonPrettyPrint(JSON.stringify(channelCreationParameters))
       const confirmed = await this.simplePrompt({ type: 'confirm', message: 'Do you confirm the provided input?' })
 
-      if (confirmed && channelCreationParametersInput)  {
-        saveOutputJson(output, `${channelCreationParametersInput.meta.title}Channel.json`, channelCreationParametersInput)
+      if (confirmed && channelCreationParametersInput) {
+        saveOutputJson(
+          output,
+          `${channelCreationParametersInput.meta.title}Channel.json`,
+          channelCreationParametersInput
+        )
         this.log('Sending the extrinsic...')
 
         await this.sendAndFollowNamedTx(currentAccount, 'content', 'createChannel', [actor, channelCreationParameters])
-
       }
     } else {
       this.log('Input invalid or was not provided...')

+ 7 - 4
cli/src/commands/content/createVideo.ts

@@ -36,7 +36,7 @@ export default class CreateVideoCommand extends ContentDirectoryCommandBase {
       let videoCreationParametersInput = await getInputJson<VideoCreationParametersInput>(input)
 
       const api = await this.getOriginalApi()
-      
+
       const meta = videoMetadataFromInput(api, videoCreationParametersInput)
 
       let videoCreationParameters: VideoCreationParameters = {
@@ -47,12 +47,15 @@ export default class CreateVideoCommand extends ContentDirectoryCommandBase {
       this.jsonPrettyPrint(JSON.stringify(videoCreationParameters))
       const confirmed = await this.simplePrompt({ type: 'confirm', message: 'Do you confirm the provided input?' })
 
-      if (confirmed && videoCreationParametersInput)  {
+      if (confirmed && videoCreationParametersInput) {
         saveOutputJson(output, `${videoCreationParametersInput.meta.title}Video.json`, videoCreationParametersInput)
         this.log('Sending the extrinsic...')
 
-        await this.sendAndFollowNamedTx(currentAccount, 'content', 'createVideo', [actor, channelId, videoCreationParameters])
-
+        await this.sendAndFollowNamedTx(currentAccount, 'content', 'createVideo', [
+          actor,
+          channelId,
+          videoCreationParameters,
+        ])
       }
     } else {
       this.log('Input invalid or was not provided...')

+ 7 - 5
cli/src/commands/content/updateChannel.ts

@@ -19,7 +19,6 @@ export default class UpdateChannelCommand extends ContentDirectoryCommandBase {
   ]
 
   async run() {
-
     let { context, input, output } = this.parse(UpdateChannelCommand).flags
 
     const { channelId } = this.parse(UpdateChannelCommand).args
@@ -35,7 +34,7 @@ export default class UpdateChannelCommand extends ContentDirectoryCommandBase {
 
     if (input) {
       let channelUpdateParametersInput = await getInputJson<ChannelUpdateParametersInput>(input)
-   
+
       const api = await this.getOriginalApi()
 
       const meta = channelMetadataFromInput(api, channelUpdateParametersInput)
@@ -49,12 +48,15 @@ export default class UpdateChannelCommand extends ContentDirectoryCommandBase {
       this.jsonPrettyPrint(JSON.stringify(channelUpdateParameters))
       const confirmed = await this.simplePrompt({ type: 'confirm', message: 'Do you confirm the provided input?' })
 
-      if (confirmed && channelUpdateParameters)  {
+      if (confirmed && channelUpdateParameters) {
         saveOutputJson(output, `${channelUpdateParametersInput.meta.title}Channel.json`, channelUpdateParametersInput)
         this.log('Sending the extrinsic...')
 
-        await this.sendAndFollowNamedTx(currentAccount, 'content', 'updateChannel', [actor, channelId, channelUpdateParameters])
-
+        await this.sendAndFollowNamedTx(currentAccount, 'content', 'updateChannel', [
+          actor,
+          channelId,
+          channelUpdateParameters,
+        ])
       }
     } else {
       this.log('Input invalid or was not provided...')

+ 7 - 4
cli/src/commands/content/updateVideo.ts

@@ -36,7 +36,7 @@ export default class UpdateVideoCommand extends ContentDirectoryCommandBase {
       let videoUpdateParametersInput = await getInputJson<VideoUpdateParametersInput>(input)
 
       const api = await this.getOriginalApi()
-      
+
       const meta = videoMetadataFromInput(api, videoUpdateParametersInput)
 
       let videoUpdateParameters: VideoUpdateParameters = {
@@ -47,12 +47,15 @@ export default class UpdateVideoCommand extends ContentDirectoryCommandBase {
       this.jsonPrettyPrint(JSON.stringify(videoUpdateParameters))
       const confirmed = await this.simplePrompt({ type: 'confirm', message: 'Do you confirm the provided input?' })
 
-      if (confirmed && videoUpdateParametersInput)  {
+      if (confirmed && videoUpdateParametersInput) {
         saveOutputJson(output, `${videoUpdateParametersInput.meta.title}Video.json`, videoUpdateParametersInput)
         this.log('Sending the extrinsic...')
 
-        await this.sendAndFollowNamedTx(currentAccount, 'content', 'updateVideo', [actor, videoId, videoUpdateParameters])
-
+        await this.sendAndFollowNamedTx(currentAccount, 'content', 'updateVideo', [
+          actor,
+          videoId,
+          videoUpdateParameters,
+        ])
       }
     } else {
       this.log('Input invalid or was not provided...')

+ 6 - 6
cli/src/commands/content/videos.ts

@@ -19,21 +19,21 @@ export default class VideosCommand extends ContentDirectoryCommandBase {
     let videos = await this.getApi().availableVideos()
 
     if (channelId) {
-        videos = videos.filter(([, /* id */ video]) => video.in_channel.eqn(channelId))
+      videos = videos.filter(([, /* id */ video]) => video.in_channel.eqn(channelId))
     }
 
     if (videos.length > 0) {
       displayTable(
         videos.map(([id, v]) => ({
-            'ID': id.toString(),
-            'InChannel': v.in_channel.toString(),
-            'InSeries': v.in_series.toString(),
-            'IsCensored': v.is_censored.toString(),
+          'ID': id.toString(),
+          'InChannel': v.in_channel.toString(),
+          'InSeries': v.in_series.toString(),
+          'IsCensored': v.is_censored.toString(),
         })),
         3
       )
     } else {
-        this.log('There are no videos yet')
+      this.log('There are no videos yet')
     }
   }
 }

+ 12 - 13
cli/src/helpers/InputOutput.ts

@@ -5,7 +5,6 @@ import fs from 'fs'
 import path from 'path'
 import chalk from 'chalk'
 
-
 export const IOFlags = {
   input: flags.string({
     char: 'i',
@@ -21,19 +20,19 @@ export const IOFlags = {
 }
 
 export async function getInputJson<T>(inputPath: string): Promise<T> {
-    let content, jsonObj
-    try {
-      content = fs.readFileSync(inputPath).toString()
-    } catch (e) {
-      throw new CLIError(`Cannot access the input file at: ${inputPath}`, { exit: ExitCodes.FsOperationFailed })
-    }
-    try {
-      jsonObj = JSON.parse(content)
-    } catch (e) {
-      throw new CLIError(`JSON parsing failed for file: ${inputPath}`, { exit: ExitCodes.InvalidInput })
-    }
+  let content, jsonObj
+  try {
+    content = fs.readFileSync(inputPath).toString()
+  } catch (e) {
+    throw new CLIError(`Cannot access the input file at: ${inputPath}`, { exit: ExitCodes.FsOperationFailed })
+  }
+  try {
+    jsonObj = JSON.parse(content)
+  } catch (e) {
+    throw new CLIError(`JSON parsing failed for file: ${inputPath}`, { exit: ExitCodes.InvalidInput })
+  }
 
-    return jsonObj as T
+  return jsonObj as T
 }
 
 export function saveOutputJson(outputPath: string | undefined, fileName: string, data: any): void {

+ 1 - 1
cli/src/helpers/JsonSchemaPrompt.ts

@@ -23,7 +23,7 @@ export class JsonSchemaPrompter<JsonResult> {
     schema: JSONSchema,
     defaults?: Partial<JsonResult>,
     customPrompts?: JsonSchemaCustomPrompts,
-    schemaPath: string = ""
+    schemaPath: string = ''
   ) {
     this.customPropmpts = customPrompts
     this.schema = schema

+ 71 - 54
cli/src/helpers/serialization.ts

@@ -1,61 +1,78 @@
-import {VideoMetadata, PublishedBeforeJoystream, License, MediaType, ChannelMetadata} from '@joystream/content-metadata-protobuf'
-import { VideoUpdateParametersInput, VideoCreationParametersInput, ChannelUpdateParametersInput, ChannelCreationParametersInput } from '../Types'
+import {
+  VideoMetadata,
+  PublishedBeforeJoystream,
+  License,
+  MediaType,
+  ChannelMetadata,
+} from '@joystream/content-metadata-protobuf'
+import {
+  VideoUpdateParametersInput,
+  VideoCreationParametersInput,
+  ChannelUpdateParametersInput,
+  ChannelCreationParametersInput,
+} from '../Types'
 import { ApiPromise } from '@polkadot/api'
-import { Bytes } from '@polkadot/types/primitive';
+import { Bytes } from '@polkadot/types/primitive'
 
 export function BinaryToMeta(api: ApiPromise, serialized: Uint8Array): Bytes {
-    const metaRaw = api.createType('Raw', serialized)
-    return new Bytes(api.registry, metaRaw)
+  const metaRaw = api.createType('Raw', serialized)
+  return new Bytes(api.registry, metaRaw)
 }
 
-export function videoMetadataFromInput(api: ApiPromise, videoParametersInput: VideoCreationParametersInput | VideoUpdateParametersInput): Bytes {
-    let mediaType = new MediaType()
-    mediaType.setCodecName(videoParametersInput.meta.mediaType?.codecName!)
-    mediaType.setContainer(videoParametersInput.meta.mediaType?.container!)
-    mediaType.setMimeMediaType(videoParametersInput.meta.mediaType?.mimeMediaType!)
-
-    let license = new License()
-    license.setCode(videoParametersInput.meta.license?.code!)
-    license.setAttribution(videoParametersInput.meta.license?.attribution!)
-    license.setCustomText(videoParametersInput.meta.license?.customText!)
-
-    let publishedBeforeJoystream = new PublishedBeforeJoystream()
-    publishedBeforeJoystream.setIsPublished(videoParametersInput.meta.publishedBeforeJoystream?.isPublished!)
-    publishedBeforeJoystream.setDate(videoParametersInput.meta.publishedBeforeJoystream?.date!)
-
-    let videoMetadata = new VideoMetadata()
-    videoMetadata.setTitle(videoParametersInput.meta.title!)
-    videoMetadata.setDescription(videoParametersInput.meta.description!)
-    videoMetadata.setVideo(videoParametersInput.meta.video!)
-    videoMetadata.setThumbnailPhoto(videoParametersInput.meta.thumbnailPhoto!)
-    videoMetadata.setDuration(videoParametersInput.meta.duration!)
-    videoMetadata.setMediaPixelHeight(videoParametersInput.meta.mediaPixelHeight!)
-    videoMetadata.setMediaPixelWidth(videoParametersInput.meta.mediaPixelWidth!)
-    videoMetadata.setLanguage(videoParametersInput.meta.language!)
-    videoMetadata.setHasMarketing(videoParametersInput.meta.hasMarketing!)
-    videoMetadata.setIsPublic(videoParametersInput.meta.isPublic!)
-    videoMetadata.setIsExplicit(videoParametersInput.meta.isExplicit!)
-    videoMetadata.setPersonsList(videoParametersInput.meta.personsList!)
-    videoMetadata.setCategory(videoParametersInput.meta.category!)
-
-    videoMetadata.setMediaType(mediaType)
-    videoMetadata.setLicense(license)
-    videoMetadata.setPublishedBeforeJoystream(publishedBeforeJoystream)
-
-    const serialized = videoMetadata.serializeBinary()
-    return BinaryToMeta(api, serialized)
+export function videoMetadataFromInput(
+  api: ApiPromise,
+  videoParametersInput: VideoCreationParametersInput | VideoUpdateParametersInput
+): Bytes {
+  let mediaType = new MediaType()
+  mediaType.setCodecName(videoParametersInput.meta.mediaType?.codecName!)
+  mediaType.setContainer(videoParametersInput.meta.mediaType?.container!)
+  mediaType.setMimeMediaType(videoParametersInput.meta.mediaType?.mimeMediaType!)
+
+  let license = new License()
+  license.setCode(videoParametersInput.meta.license?.code!)
+  license.setAttribution(videoParametersInput.meta.license?.attribution!)
+  license.setCustomText(videoParametersInput.meta.license?.customText!)
+
+  let publishedBeforeJoystream = new PublishedBeforeJoystream()
+  publishedBeforeJoystream.setIsPublished(videoParametersInput.meta.publishedBeforeJoystream?.isPublished!)
+  publishedBeforeJoystream.setDate(videoParametersInput.meta.publishedBeforeJoystream?.date!)
+
+  let videoMetadata = new VideoMetadata()
+  videoMetadata.setTitle(videoParametersInput.meta.title!)
+  videoMetadata.setDescription(videoParametersInput.meta.description!)
+  videoMetadata.setVideo(videoParametersInput.meta.video!)
+  videoMetadata.setThumbnailPhoto(videoParametersInput.meta.thumbnailPhoto!)
+  videoMetadata.setDuration(videoParametersInput.meta.duration!)
+  videoMetadata.setMediaPixelHeight(videoParametersInput.meta.mediaPixelHeight!)
+  videoMetadata.setMediaPixelWidth(videoParametersInput.meta.mediaPixelWidth!)
+  videoMetadata.setLanguage(videoParametersInput.meta.language!)
+  videoMetadata.setHasMarketing(videoParametersInput.meta.hasMarketing!)
+  videoMetadata.setIsPublic(videoParametersInput.meta.isPublic!)
+  videoMetadata.setIsExplicit(videoParametersInput.meta.isExplicit!)
+  videoMetadata.setPersonsList(videoParametersInput.meta.personsList!)
+  videoMetadata.setCategory(videoParametersInput.meta.category!)
+
+  videoMetadata.setMediaType(mediaType)
+  videoMetadata.setLicense(license)
+  videoMetadata.setPublishedBeforeJoystream(publishedBeforeJoystream)
+
+  const serialized = videoMetadata.serializeBinary()
+  return BinaryToMeta(api, serialized)
 }
 
-export function channelMetadataFromInput(api: ApiPromise, channelParametersInput: ChannelCreationParametersInput | ChannelUpdateParametersInput): Bytes {
-    let channelMetadata = new ChannelMetadata()
-    channelMetadata.setTitle(channelParametersInput.meta.title!)
-    channelMetadata.setDescription(channelParametersInput.meta.description!)
-    channelMetadata.setIsPublic(channelParametersInput.meta.isPublic!)
-    channelMetadata.setLanguage(channelParametersInput.meta.language!)
-    channelMetadata.setCoverPhoto(channelParametersInput.meta.coverPhoto!)
-    channelMetadata.setAvatarPhoto(channelParametersInput.meta.avatarPhoto!)
-    channelMetadata.setCategory(channelParametersInput.meta.category!)
-
-    const serialized = channelMetadata.serializeBinary()
-    return BinaryToMeta(api, serialized)
-}
+export function channelMetadataFromInput(
+  api: ApiPromise,
+  channelParametersInput: ChannelCreationParametersInput | ChannelUpdateParametersInput
+): Bytes {
+  let channelMetadata = new ChannelMetadata()
+  channelMetadata.setTitle(channelParametersInput.meta.title!)
+  channelMetadata.setDescription(channelParametersInput.meta.description!)
+  channelMetadata.setIsPublic(channelParametersInput.meta.isPublic!)
+  channelMetadata.setLanguage(channelParametersInput.meta.language!)
+  channelMetadata.setCoverPhoto(channelParametersInput.meta.coverPhoto!)
+  channelMetadata.setAvatarPhoto(channelParametersInput.meta.avatarPhoto!)
+  channelMetadata.setCategory(channelParametersInput.meta.category!)
+
+  const serialized = channelMetadata.serializeBinary()
+  return BinaryToMeta(api, serialized)
+}

+ 1 - 1
content-metadata-protobuf/compiled/proto/Channel_pb.d.ts

@@ -1,4 +1,4 @@
-// package: muthu.other
+// package: 
 // file: proto/Channel.proto
 
 import * as jspb from "google-protobuf";

+ 211 - 141
content-metadata-protobuf/compiled/proto/Channel_pb.js

@@ -1,19 +1,43 @@
+// source: proto/Channel.proto
 /**
  * @fileoverview
  * @enhanceable
+ * @suppress {missingRequire} reports error on implicit type usages.
  * @suppress {messageConventions} JS Compiler reports an error if a variable or
  *     field starts with 'MSG_' and isn't a translatable message.
  * @public
  */
 // GENERATED CODE -- DO NOT EDIT!
+/* eslint-disable */
+// @ts-nocheck
 
 var jspb = require('google-protobuf');
 var goog = jspb;
 var global = Function('return this')();
 
-goog.exportSymbol('proto.muthu.other.ChannelCategoryMetadata', null, global);
-goog.exportSymbol('proto.muthu.other.ChannelMetadata', null, global);
-
+goog.exportSymbol('proto.ChannelCategoryMetadata', null, global);
+goog.exportSymbol('proto.ChannelMetadata', null, global);
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.ChannelMetadata = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.ChannelMetadata, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
+  proto.ChannelMetadata.displayName = 'proto.ChannelMetadata';
+}
 /**
  * Generated by JsPbCodeGenerator.
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -24,49 +48,56 @@ goog.exportSymbol('proto.muthu.other.ChannelMetadata', null, global);
  * @extends {jspb.Message}
  * @constructor
  */
-proto.muthu.other.ChannelMetadata = function(opt_data) {
+proto.ChannelCategoryMetadata = function(opt_data) {
   jspb.Message.initialize(this, opt_data, 0, -1, null, null);
 };
-goog.inherits(proto.muthu.other.ChannelMetadata, jspb.Message);
+goog.inherits(proto.ChannelCategoryMetadata, jspb.Message);
 if (goog.DEBUG && !COMPILED) {
-  proto.muthu.other.ChannelMetadata.displayName = 'proto.muthu.other.ChannelMetadata';
+  /**
+   * @public
+   * @override
+   */
+  proto.ChannelCategoryMetadata.displayName = 'proto.ChannelCategoryMetadata';
 }
 
 
+
 if (jspb.Message.GENERATE_TO_OBJECT) {
 /**
- * Creates an object representation of this proto suitable for use in Soy templates.
+ * Creates an object representation of this proto.
  * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
  * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
  * @return {!Object}
  */
-proto.muthu.other.ChannelMetadata.prototype.toObject = function(opt_includeInstance) {
-  return proto.muthu.other.ChannelMetadata.toObject(opt_includeInstance, this);
+proto.ChannelMetadata.prototype.toObject = function(opt_includeInstance) {
+  return proto.ChannelMetadata.toObject(opt_includeInstance, this);
 };
 
 
 /**
  * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
  *     http://goto/soy-param-migration
- * @param {!proto.muthu.other.ChannelMetadata} msg The msg instance to transform.
+ * @param {!proto.ChannelMetadata} msg The msg instance to transform.
  * @return {!Object}
  * @suppress {unusedLocalVariables} f is only used for nested messages
  */
-proto.muthu.other.ChannelMetadata.toObject = function(includeInstance, msg) {
+proto.ChannelMetadata.toObject = function(includeInstance, msg) {
   var f, obj = {
-    title: jspb.Message.getField(msg, 1),
-    description: jspb.Message.getField(msg, 2),
-    isPublic: jspb.Message.getField(msg, 3),
-    language: jspb.Message.getField(msg, 4),
-    coverPhoto: jspb.Message.getField(msg, 5),
-    avatarPhoto: jspb.Message.getField(msg, 6),
-    category: jspb.Message.getField(msg, 7)
+    title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    description: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
+    isPublic: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f,
+    language: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f,
+    coverPhoto: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f,
+    avatarPhoto: (f = jspb.Message.getField(msg, 6)) == null ? undefined : f,
+    category: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f
   };
 
   if (includeInstance) {
@@ -80,23 +111,23 @@ proto.muthu.other.ChannelMetadata.toObject = function(includeInstance, msg) {
 /**
  * Deserializes binary data (in protobuf wire format).
  * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.muthu.other.ChannelMetadata}
+ * @return {!proto.ChannelMetadata}
  */
-proto.muthu.other.ChannelMetadata.deserializeBinary = function(bytes) {
+proto.ChannelMetadata.deserializeBinary = function(bytes) {
   var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.muthu.other.ChannelMetadata;
-  return proto.muthu.other.ChannelMetadata.deserializeBinaryFromReader(msg, reader);
+  var msg = new proto.ChannelMetadata;
+  return proto.ChannelMetadata.deserializeBinaryFromReader(msg, reader);
 };
 
 
 /**
  * Deserializes binary data (in protobuf wire format) from the
  * given reader into the given message object.
- * @param {!proto.muthu.other.ChannelMetadata} msg The message object to deserialize into.
+ * @param {!proto.ChannelMetadata} msg The message object to deserialize into.
  * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.muthu.other.ChannelMetadata}
+ * @return {!proto.ChannelMetadata}
  */
-proto.muthu.other.ChannelMetadata.deserializeBinaryFromReader = function(msg, reader) {
+proto.ChannelMetadata.deserializeBinaryFromReader = function(msg, reader) {
   while (reader.nextField()) {
     if (reader.isEndGroup()) {
       break;
@@ -144,9 +175,9 @@ proto.muthu.other.ChannelMetadata.deserializeBinaryFromReader = function(msg, re
  * Serializes the message to binary data (in protobuf wire format).
  * @return {!Uint8Array}
  */
-proto.muthu.other.ChannelMetadata.prototype.serializeBinary = function() {
+proto.ChannelMetadata.prototype.serializeBinary = function() {
   var writer = new jspb.BinaryWriter();
-  proto.muthu.other.ChannelMetadata.serializeBinaryToWriter(this, writer);
+  proto.ChannelMetadata.serializeBinaryToWriter(this, writer);
   return writer.getResultBuffer();
 };
 
@@ -154,11 +185,11 @@ proto.muthu.other.ChannelMetadata.prototype.serializeBinary = function() {
 /**
  * Serializes the given message to binary data (in protobuf wire
  * format), writing to the given BinaryWriter.
- * @param {!proto.muthu.other.ChannelMetadata} message
+ * @param {!proto.ChannelMetadata} message
  * @param {!jspb.BinaryWriter} writer
  * @suppress {unusedLocalVariables} f is only used for nested messages
  */
-proto.muthu.other.ChannelMetadata.serializeBinaryToWriter = function(message, writer) {
+proto.ChannelMetadata.serializeBinaryToWriter = function(message, writer) {
   var f = undefined;
   f = /** @type {string} */ (jspb.Message.getField(message, 1));
   if (f != null) {
@@ -216,27 +247,34 @@ proto.muthu.other.ChannelMetadata.serializeBinaryToWriter = function(message, wr
  * optional string title = 1;
  * @return {string}
  */
-proto.muthu.other.ChannelMetadata.prototype.getTitle = function() {
+proto.ChannelMetadata.prototype.getTitle = function() {
   return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
 };
 
 
-/** @param {string} value */
-proto.muthu.other.ChannelMetadata.prototype.setTitle = function(value) {
-  jspb.Message.setField(this, 1, value);
+/**
+ * @param {string} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setTitle = function(value) {
+  return jspb.Message.setField(this, 1, value);
 };
 
 
-proto.muthu.other.ChannelMetadata.prototype.clearTitle = function() {
-  jspb.Message.setField(this, 1, undefined);
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearTitle = function() {
+  return jspb.Message.setField(this, 1, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
-proto.muthu.other.ChannelMetadata.prototype.hasTitle = function() {
+proto.ChannelMetadata.prototype.hasTitle = function() {
   return jspb.Message.getField(this, 1) != null;
 };
 
@@ -245,58 +283,70 @@ proto.muthu.other.ChannelMetadata.prototype.hasTitle = function() {
  * optional string description = 2;
  * @return {string}
  */
-proto.muthu.other.ChannelMetadata.prototype.getDescription = function() {
+proto.ChannelMetadata.prototype.getDescription = function() {
   return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
 };
 
 
-/** @param {string} value */
-proto.muthu.other.ChannelMetadata.prototype.setDescription = function(value) {
-  jspb.Message.setField(this, 2, value);
+/**
+ * @param {string} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setDescription = function(value) {
+  return jspb.Message.setField(this, 2, value);
 };
 
 
-proto.muthu.other.ChannelMetadata.prototype.clearDescription = function() {
-  jspb.Message.setField(this, 2, undefined);
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearDescription = function() {
+  return jspb.Message.setField(this, 2, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
-proto.muthu.other.ChannelMetadata.prototype.hasDescription = function() {
+proto.ChannelMetadata.prototype.hasDescription = function() {
   return jspb.Message.getField(this, 2) != null;
 };
 
 
 /**
  * optional bool is_public = 3;
- * Note that Boolean fields may be set to 0/1 when serialized from a Java server.
- * You should avoid comparisons like {@code val === true/false} in those cases.
  * @return {boolean}
  */
-proto.muthu.other.ChannelMetadata.prototype.getIsPublic = function() {
-  return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 3, false));
+proto.ChannelMetadata.prototype.getIsPublic = function() {
+  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
 };
 
 
-/** @param {boolean} value */
-proto.muthu.other.ChannelMetadata.prototype.setIsPublic = function(value) {
-  jspb.Message.setField(this, 3, value);
+/**
+ * @param {boolean} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setIsPublic = function(value) {
+  return jspb.Message.setField(this, 3, value);
 };
 
 
-proto.muthu.other.ChannelMetadata.prototype.clearIsPublic = function() {
-  jspb.Message.setField(this, 3, undefined);
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearIsPublic = function() {
+  return jspb.Message.setField(this, 3, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
-proto.muthu.other.ChannelMetadata.prototype.hasIsPublic = function() {
+proto.ChannelMetadata.prototype.hasIsPublic = function() {
   return jspb.Message.getField(this, 3) != null;
 };
 
@@ -305,27 +355,34 @@ proto.muthu.other.ChannelMetadata.prototype.hasIsPublic = function() {
  * optional string language = 4;
  * @return {string}
  */
-proto.muthu.other.ChannelMetadata.prototype.getLanguage = function() {
+proto.ChannelMetadata.prototype.getLanguage = function() {
   return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
 };
 
 
-/** @param {string} value */
-proto.muthu.other.ChannelMetadata.prototype.setLanguage = function(value) {
-  jspb.Message.setField(this, 4, value);
+/**
+ * @param {string} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setLanguage = function(value) {
+  return jspb.Message.setField(this, 4, value);
 };
 
 
-proto.muthu.other.ChannelMetadata.prototype.clearLanguage = function() {
-  jspb.Message.setField(this, 4, undefined);
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearLanguage = function() {
+  return jspb.Message.setField(this, 4, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
-proto.muthu.other.ChannelMetadata.prototype.hasLanguage = function() {
+proto.ChannelMetadata.prototype.hasLanguage = function() {
   return jspb.Message.getField(this, 4) != null;
 };
 
@@ -334,27 +391,34 @@ proto.muthu.other.ChannelMetadata.prototype.hasLanguage = function() {
  * optional uint32 cover_photo = 5;
  * @return {number}
  */
-proto.muthu.other.ChannelMetadata.prototype.getCoverPhoto = function() {
+proto.ChannelMetadata.prototype.getCoverPhoto = function() {
   return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
 };
 
 
-/** @param {number} value */
-proto.muthu.other.ChannelMetadata.prototype.setCoverPhoto = function(value) {
-  jspb.Message.setField(this, 5, value);
+/**
+ * @param {number} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setCoverPhoto = function(value) {
+  return jspb.Message.setField(this, 5, value);
 };
 
 
-proto.muthu.other.ChannelMetadata.prototype.clearCoverPhoto = function() {
-  jspb.Message.setField(this, 5, undefined);
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearCoverPhoto = function() {
+  return jspb.Message.setField(this, 5, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
-proto.muthu.other.ChannelMetadata.prototype.hasCoverPhoto = function() {
+proto.ChannelMetadata.prototype.hasCoverPhoto = function() {
   return jspb.Message.getField(this, 5) != null;
 };
 
@@ -363,27 +427,34 @@ proto.muthu.other.ChannelMetadata.prototype.hasCoverPhoto = function() {
  * optional uint32 avatar_photo = 6;
  * @return {number}
  */
-proto.muthu.other.ChannelMetadata.prototype.getAvatarPhoto = function() {
+proto.ChannelMetadata.prototype.getAvatarPhoto = function() {
   return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
 };
 
 
-/** @param {number} value */
-proto.muthu.other.ChannelMetadata.prototype.setAvatarPhoto = function(value) {
-  jspb.Message.setField(this, 6, value);
+/**
+ * @param {number} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setAvatarPhoto = function(value) {
+  return jspb.Message.setField(this, 6, value);
 };
 
 
-proto.muthu.other.ChannelMetadata.prototype.clearAvatarPhoto = function() {
-  jspb.Message.setField(this, 6, undefined);
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearAvatarPhoto = function() {
+  return jspb.Message.setField(this, 6, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
-proto.muthu.other.ChannelMetadata.prototype.hasAvatarPhoto = function() {
+proto.ChannelMetadata.prototype.hasAvatarPhoto = function() {
   return jspb.Message.getField(this, 6) != null;
 };
 
@@ -392,79 +463,71 @@ proto.muthu.other.ChannelMetadata.prototype.hasAvatarPhoto = function() {
  * optional uint64 category = 7;
  * @return {number}
  */
-proto.muthu.other.ChannelMetadata.prototype.getCategory = function() {
+proto.ChannelMetadata.prototype.getCategory = function() {
   return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
 };
 
 
-/** @param {number} value */
-proto.muthu.other.ChannelMetadata.prototype.setCategory = function(value) {
-  jspb.Message.setField(this, 7, value);
+/**
+ * @param {number} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setCategory = function(value) {
+  return jspb.Message.setField(this, 7, value);
 };
 
 
-proto.muthu.other.ChannelMetadata.prototype.clearCategory = function() {
-  jspb.Message.setField(this, 7, undefined);
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearCategory = function() {
+  return jspb.Message.setField(this, 7, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
-proto.muthu.other.ChannelMetadata.prototype.hasCategory = function() {
+proto.ChannelMetadata.prototype.hasCategory = function() {
   return jspb.Message.getField(this, 7) != null;
 };
 
 
 
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.muthu.other.ChannelCategoryMetadata = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.muthu.other.ChannelCategoryMetadata, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.muthu.other.ChannelCategoryMetadata.displayName = 'proto.muthu.other.ChannelCategoryMetadata';
-}
 
 
 if (jspb.Message.GENERATE_TO_OBJECT) {
 /**
- * Creates an object representation of this proto suitable for use in Soy templates.
+ * Creates an object representation of this proto.
  * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
  * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
  * @return {!Object}
  */
-proto.muthu.other.ChannelCategoryMetadata.prototype.toObject = function(opt_includeInstance) {
-  return proto.muthu.other.ChannelCategoryMetadata.toObject(opt_includeInstance, this);
+proto.ChannelCategoryMetadata.prototype.toObject = function(opt_includeInstance) {
+  return proto.ChannelCategoryMetadata.toObject(opt_includeInstance, this);
 };
 
 
 /**
  * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
  *     http://goto/soy-param-migration
- * @param {!proto.muthu.other.ChannelCategoryMetadata} msg The msg instance to transform.
+ * @param {!proto.ChannelCategoryMetadata} msg The msg instance to transform.
  * @return {!Object}
  * @suppress {unusedLocalVariables} f is only used for nested messages
  */
-proto.muthu.other.ChannelCategoryMetadata.toObject = function(includeInstance, msg) {
+proto.ChannelCategoryMetadata.toObject = function(includeInstance, msg) {
   var f, obj = {
-    name: jspb.Message.getField(msg, 1)
+    name: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f
   };
 
   if (includeInstance) {
@@ -478,23 +541,23 @@ proto.muthu.other.ChannelCategoryMetadata.toObject = function(includeInstance, m
 /**
  * Deserializes binary data (in protobuf wire format).
  * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.muthu.other.ChannelCategoryMetadata}
+ * @return {!proto.ChannelCategoryMetadata}
  */
-proto.muthu.other.ChannelCategoryMetadata.deserializeBinary = function(bytes) {
+proto.ChannelCategoryMetadata.deserializeBinary = function(bytes) {
   var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.muthu.other.ChannelCategoryMetadata;
-  return proto.muthu.other.ChannelCategoryMetadata.deserializeBinaryFromReader(msg, reader);
+  var msg = new proto.ChannelCategoryMetadata;
+  return proto.ChannelCategoryMetadata.deserializeBinaryFromReader(msg, reader);
 };
 
 
 /**
  * Deserializes binary data (in protobuf wire format) from the
  * given reader into the given message object.
- * @param {!proto.muthu.other.ChannelCategoryMetadata} msg The message object to deserialize into.
+ * @param {!proto.ChannelCategoryMetadata} msg The message object to deserialize into.
  * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.muthu.other.ChannelCategoryMetadata}
+ * @return {!proto.ChannelCategoryMetadata}
  */
-proto.muthu.other.ChannelCategoryMetadata.deserializeBinaryFromReader = function(msg, reader) {
+proto.ChannelCategoryMetadata.deserializeBinaryFromReader = function(msg, reader) {
   while (reader.nextField()) {
     if (reader.isEndGroup()) {
       break;
@@ -518,9 +581,9 @@ proto.muthu.other.ChannelCategoryMetadata.deserializeBinaryFromReader = function
  * Serializes the message to binary data (in protobuf wire format).
  * @return {!Uint8Array}
  */
-proto.muthu.other.ChannelCategoryMetadata.prototype.serializeBinary = function() {
+proto.ChannelCategoryMetadata.prototype.serializeBinary = function() {
   var writer = new jspb.BinaryWriter();
-  proto.muthu.other.ChannelCategoryMetadata.serializeBinaryToWriter(this, writer);
+  proto.ChannelCategoryMetadata.serializeBinaryToWriter(this, writer);
   return writer.getResultBuffer();
 };
 
@@ -528,11 +591,11 @@ proto.muthu.other.ChannelCategoryMetadata.prototype.serializeBinary = function()
 /**
  * Serializes the given message to binary data (in protobuf wire
  * format), writing to the given BinaryWriter.
- * @param {!proto.muthu.other.ChannelCategoryMetadata} message
+ * @param {!proto.ChannelCategoryMetadata} message
  * @param {!jspb.BinaryWriter} writer
  * @suppress {unusedLocalVariables} f is only used for nested messages
  */
-proto.muthu.other.ChannelCategoryMetadata.serializeBinaryToWriter = function(message, writer) {
+proto.ChannelCategoryMetadata.serializeBinaryToWriter = function(message, writer) {
   var f = undefined;
   f = /** @type {string} */ (jspb.Message.getField(message, 1));
   if (f != null) {
@@ -548,29 +611,36 @@ proto.muthu.other.ChannelCategoryMetadata.serializeBinaryToWriter = function(mes
  * optional string name = 1;
  * @return {string}
  */
-proto.muthu.other.ChannelCategoryMetadata.prototype.getName = function() {
+proto.ChannelCategoryMetadata.prototype.getName = function() {
   return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
 };
 
 
-/** @param {string} value */
-proto.muthu.other.ChannelCategoryMetadata.prototype.setName = function(value) {
-  jspb.Message.setField(this, 1, value);
+/**
+ * @param {string} value
+ * @return {!proto.ChannelCategoryMetadata} returns this
+ */
+proto.ChannelCategoryMetadata.prototype.setName = function(value) {
+  return jspb.Message.setField(this, 1, value);
 };
 
 
-proto.muthu.other.ChannelCategoryMetadata.prototype.clearName = function() {
-  jspb.Message.setField(this, 1, undefined);
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelCategoryMetadata} returns this
+ */
+proto.ChannelCategoryMetadata.prototype.clearName = function() {
+  return jspb.Message.setField(this, 1, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
-proto.muthu.other.ChannelCategoryMetadata.prototype.hasName = function() {
+proto.ChannelCategoryMetadata.prototype.hasName = function() {
   return jspb.Message.getField(this, 1) != null;
 };
 
 
-goog.object.extend(exports, proto.muthu.other);
+goog.object.extend(exports, proto);

+ 89 - 37
content-metadata-protobuf/compiled/proto/Person_pb.js

@@ -1,18 +1,21 @@
+// source: proto/Person.proto
 /**
  * @fileoverview
  * @enhanceable
+ * @suppress {missingRequire} reports error on implicit type usages.
  * @suppress {messageConventions} JS Compiler reports an error if a variable or
  *     field starts with 'MSG_' and isn't a translatable message.
  * @public
  */
 // GENERATED CODE -- DO NOT EDIT!
+/* eslint-disable */
+// @ts-nocheck
 
 var jspb = require('google-protobuf');
 var goog = jspb;
 var global = Function('return this')();
 
 goog.exportSymbol('proto.PersonMetadata', null, global);
-
 /**
  * Generated by JsPbCodeGenerator.
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -28,19 +31,26 @@ proto.PersonMetadata = function(opt_data) {
 };
 goog.inherits(proto.PersonMetadata, jspb.Message);
 if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
   proto.PersonMetadata.displayName = 'proto.PersonMetadata';
 }
 
 
+
 if (jspb.Message.GENERATE_TO_OBJECT) {
 /**
- * Creates an object representation of this proto suitable for use in Soy templates.
+ * Creates an object representation of this proto.
  * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
  * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
  * @return {!Object}
  */
 proto.PersonMetadata.prototype.toObject = function(opt_includeInstance) {
@@ -50,8 +60,8 @@ proto.PersonMetadata.prototype.toObject = function(opt_includeInstance) {
 
 /**
  * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
  *     http://goto/soy-param-migration
  * @param {!proto.PersonMetadata} msg The msg instance to transform.
  * @return {!Object}
@@ -59,12 +69,12 @@ proto.PersonMetadata.prototype.toObject = function(opt_includeInstance) {
  */
 proto.PersonMetadata.toObject = function(includeInstance, msg) {
   var f, obj = {
-    firstName: jspb.Message.getField(msg, 1),
-    middleName: jspb.Message.getField(msg, 2),
-    lastName: jspb.Message.getField(msg, 3),
-    about: jspb.Message.getField(msg, 4),
-    coverPhoto: jspb.Message.getField(msg, 5),
-    avatarPhoto: jspb.Message.getField(msg, 6)
+    firstName: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    middleName: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
+    lastName: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
+    about: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f,
+    coverPhoto: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f,
+    avatarPhoto: (f = jspb.Message.getField(msg, 6)) == null ? undefined : f
   };
 
   if (includeInstance) {
@@ -208,20 +218,27 @@ proto.PersonMetadata.prototype.getFirstName = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.setFirstName = function(value) {
-  jspb.Message.setField(this, 1, value);
+  return jspb.Message.setField(this, 1, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.clearFirstName = function() {
-  jspb.Message.setField(this, 1, undefined);
+  return jspb.Message.setField(this, 1, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.PersonMetadata.prototype.hasFirstName = function() {
   return jspb.Message.getField(this, 1) != null;
@@ -237,20 +254,27 @@ proto.PersonMetadata.prototype.getMiddleName = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.setMiddleName = function(value) {
-  jspb.Message.setField(this, 2, value);
+  return jspb.Message.setField(this, 2, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.clearMiddleName = function() {
-  jspb.Message.setField(this, 2, undefined);
+  return jspb.Message.setField(this, 2, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.PersonMetadata.prototype.hasMiddleName = function() {
   return jspb.Message.getField(this, 2) != null;
@@ -266,20 +290,27 @@ proto.PersonMetadata.prototype.getLastName = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.setLastName = function(value) {
-  jspb.Message.setField(this, 3, value);
+  return jspb.Message.setField(this, 3, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.clearLastName = function() {
-  jspb.Message.setField(this, 3, undefined);
+  return jspb.Message.setField(this, 3, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.PersonMetadata.prototype.hasLastName = function() {
   return jspb.Message.getField(this, 3) != null;
@@ -295,20 +326,27 @@ proto.PersonMetadata.prototype.getAbout = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.setAbout = function(value) {
-  jspb.Message.setField(this, 4, value);
+  return jspb.Message.setField(this, 4, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.clearAbout = function() {
-  jspb.Message.setField(this, 4, undefined);
+  return jspb.Message.setField(this, 4, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.PersonMetadata.prototype.hasAbout = function() {
   return jspb.Message.getField(this, 4) != null;
@@ -324,20 +362,27 @@ proto.PersonMetadata.prototype.getCoverPhoto = function() {
 };
 
 
-/** @param {number} value */
+/**
+ * @param {number} value
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.setCoverPhoto = function(value) {
-  jspb.Message.setField(this, 5, value);
+  return jspb.Message.setField(this, 5, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.clearCoverPhoto = function() {
-  jspb.Message.setField(this, 5, undefined);
+  return jspb.Message.setField(this, 5, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.PersonMetadata.prototype.hasCoverPhoto = function() {
   return jspb.Message.getField(this, 5) != null;
@@ -353,20 +398,27 @@ proto.PersonMetadata.prototype.getAvatarPhoto = function() {
 };
 
 
-/** @param {number} value */
+/**
+ * @param {number} value
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.setAvatarPhoto = function(value) {
-  jspb.Message.setField(this, 6, value);
+  return jspb.Message.setField(this, 6, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PersonMetadata} returns this
+ */
 proto.PersonMetadata.prototype.clearAvatarPhoto = function() {
-  jspb.Message.setField(this, 6, undefined);
+  return jspb.Message.setField(this, 6, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.PersonMetadata.prototype.hasAvatarPhoto = function() {
   return jspb.Message.getField(this, 6) != null;

+ 47 - 20
content-metadata-protobuf/compiled/proto/Playlist_pb.js

@@ -1,18 +1,21 @@
+// source: proto/Playlist.proto
 /**
  * @fileoverview
  * @enhanceable
+ * @suppress {missingRequire} reports error on implicit type usages.
  * @suppress {messageConventions} JS Compiler reports an error if a variable or
  *     field starts with 'MSG_' and isn't a translatable message.
  * @public
  */
 // GENERATED CODE -- DO NOT EDIT!
+/* eslint-disable */
+// @ts-nocheck
 
 var jspb = require('google-protobuf');
 var goog = jspb;
 var global = Function('return this')();
 
 goog.exportSymbol('proto.PlaylistMetadata', null, global);
-
 /**
  * Generated by JsPbCodeGenerator.
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -28,8 +31,13 @@ proto.PlaylistMetadata = function(opt_data) {
 };
 goog.inherits(proto.PlaylistMetadata, jspb.Message);
 if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
   proto.PlaylistMetadata.displayName = 'proto.PlaylistMetadata';
 }
+
 /**
  * List of repeated fields within this message type.
  * @private {!Array<number>}
@@ -41,13 +49,15 @@ proto.PlaylistMetadata.repeatedFields_ = [2];
 
 if (jspb.Message.GENERATE_TO_OBJECT) {
 /**
- * Creates an object representation of this proto suitable for use in Soy templates.
+ * Creates an object representation of this proto.
  * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
  * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
  * @return {!Object}
  */
 proto.PlaylistMetadata.prototype.toObject = function(opt_includeInstance) {
@@ -57,8 +67,8 @@ proto.PlaylistMetadata.prototype.toObject = function(opt_includeInstance) {
 
 /**
  * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
  *     http://goto/soy-param-migration
  * @param {!proto.PlaylistMetadata} msg The msg instance to transform.
  * @return {!Object}
@@ -66,8 +76,8 @@ proto.PlaylistMetadata.prototype.toObject = function(opt_includeInstance) {
  */
 proto.PlaylistMetadata.toObject = function(includeInstance, msg) {
   var f, obj = {
-    title: jspb.Message.getField(msg, 1),
-    videosList: jspb.Message.getRepeatedField(msg, 2)
+    title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    videosList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
   };
 
   if (includeInstance) {
@@ -109,8 +119,10 @@ proto.PlaylistMetadata.deserializeBinaryFromReader = function(msg, reader) {
       msg.setTitle(value);
       break;
     case 2:
-      var value = /** @type {number} */ (reader.readUint64());
-      msg.addVideos(value);
+      var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]);
+      for (var i = 0; i < values.length; i++) {
+        msg.addVideos(values[i]);
+      }
       break;
     default:
       reader.skipField();
@@ -167,20 +179,27 @@ proto.PlaylistMetadata.prototype.getTitle = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.PlaylistMetadata} returns this
+ */
 proto.PlaylistMetadata.prototype.setTitle = function(value) {
-  jspb.Message.setField(this, 1, value);
+  return jspb.Message.setField(this, 1, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PlaylistMetadata} returns this
+ */
 proto.PlaylistMetadata.prototype.clearTitle = function() {
-  jspb.Message.setField(this, 1, undefined);
+  return jspb.Message.setField(this, 1, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.PlaylistMetadata.prototype.hasTitle = function() {
   return jspb.Message.getField(this, 1) != null;
@@ -196,23 +215,31 @@ proto.PlaylistMetadata.prototype.getVideosList = function() {
 };
 
 
-/** @param {!Array<number>} value */
+/**
+ * @param {!Array<number>} value
+ * @return {!proto.PlaylistMetadata} returns this
+ */
 proto.PlaylistMetadata.prototype.setVideosList = function(value) {
-  jspb.Message.setField(this, 2, value || []);
+  return jspb.Message.setField(this, 2, value || []);
 };
 
 
 /**
- * @param {!number} value
+ * @param {number} value
  * @param {number=} opt_index
+ * @return {!proto.PlaylistMetadata} returns this
  */
 proto.PlaylistMetadata.prototype.addVideos = function(value, opt_index) {
-  jspb.Message.addToRepeatedField(this, 2, value, opt_index);
+  return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
 };
 
 
+/**
+ * Clears the list making it empty but non-null.
+ * @return {!proto.PlaylistMetadata} returns this
+ */
 proto.PlaylistMetadata.prototype.clearVideosList = function() {
-  this.setVideosList([]);
+  return this.setVideosList([]);
 };
 
 

+ 154 - 76
content-metadata-protobuf/compiled/proto/Series_pb.js

@@ -1,11 +1,15 @@
+// source: proto/Series.proto
 /**
  * @fileoverview
  * @enhanceable
+ * @suppress {missingRequire} reports error on implicit type usages.
  * @suppress {messageConventions} JS Compiler reports an error if a variable or
  *     field starts with 'MSG_' and isn't a translatable message.
  * @public
  */
 // GENERATED CODE -- DO NOT EDIT!
+/* eslint-disable */
+// @ts-nocheck
 
 var jspb = require('google-protobuf');
 var goog = jspb;
@@ -13,7 +17,6 @@ var global = Function('return this')();
 
 goog.exportSymbol('proto.SeasonMetadata', null, global);
 goog.exportSymbol('proto.SeriesMetadata', null, global);
-
 /**
  * Generated by JsPbCodeGenerator.
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -29,8 +32,34 @@ proto.SeriesMetadata = function(opt_data) {
 };
 goog.inherits(proto.SeriesMetadata, jspb.Message);
 if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
   proto.SeriesMetadata.displayName = 'proto.SeriesMetadata';
 }
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.SeasonMetadata = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, -1, proto.SeasonMetadata.repeatedFields_, null);
+};
+goog.inherits(proto.SeasonMetadata, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
+  proto.SeasonMetadata.displayName = 'proto.SeasonMetadata';
+}
+
 /**
  * List of repeated fields within this message type.
  * @private {!Array<number>}
@@ -42,13 +71,15 @@ proto.SeriesMetadata.repeatedFields_ = [4];
 
 if (jspb.Message.GENERATE_TO_OBJECT) {
 /**
- * Creates an object representation of this proto suitable for use in Soy templates.
+ * Creates an object representation of this proto.
  * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
  * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
  * @return {!Object}
  */
 proto.SeriesMetadata.prototype.toObject = function(opt_includeInstance) {
@@ -58,8 +89,8 @@ proto.SeriesMetadata.prototype.toObject = function(opt_includeInstance) {
 
 /**
  * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
  *     http://goto/soy-param-migration
  * @param {!proto.SeriesMetadata} msg The msg instance to transform.
  * @return {!Object}
@@ -67,10 +98,10 @@ proto.SeriesMetadata.prototype.toObject = function(opt_includeInstance) {
  */
 proto.SeriesMetadata.toObject = function(includeInstance, msg) {
   var f, obj = {
-    title: jspb.Message.getField(msg, 1),
-    description: jspb.Message.getField(msg, 2),
-    coverPhoto: jspb.Message.getField(msg, 3),
-    personsList: jspb.Message.getRepeatedField(msg, 4)
+    title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    description: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
+    coverPhoto: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
+    personsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f
   };
 
   if (includeInstance) {
@@ -120,8 +151,10 @@ proto.SeriesMetadata.deserializeBinaryFromReader = function(msg, reader) {
       msg.setCoverPhoto(value);
       break;
     case 4:
-      var value = /** @type {!Array<number>} */ (reader.readPackedUint64());
-      msg.setPersonsList(value);
+      var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]);
+      for (var i = 0; i < values.length; i++) {
+        msg.addPersons(values[i]);
+      }
       break;
     default:
       reader.skipField();
@@ -192,20 +225,27 @@ proto.SeriesMetadata.prototype.getTitle = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.SeriesMetadata} returns this
+ */
 proto.SeriesMetadata.prototype.setTitle = function(value) {
-  jspb.Message.setField(this, 1, value);
+  return jspb.Message.setField(this, 1, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.SeriesMetadata} returns this
+ */
 proto.SeriesMetadata.prototype.clearTitle = function() {
-  jspb.Message.setField(this, 1, undefined);
+  return jspb.Message.setField(this, 1, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.SeriesMetadata.prototype.hasTitle = function() {
   return jspb.Message.getField(this, 1) != null;
@@ -221,20 +261,27 @@ proto.SeriesMetadata.prototype.getDescription = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.SeriesMetadata} returns this
+ */
 proto.SeriesMetadata.prototype.setDescription = function(value) {
-  jspb.Message.setField(this, 2, value);
+  return jspb.Message.setField(this, 2, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.SeriesMetadata} returns this
+ */
 proto.SeriesMetadata.prototype.clearDescription = function() {
-  jspb.Message.setField(this, 2, undefined);
+  return jspb.Message.setField(this, 2, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.SeriesMetadata.prototype.hasDescription = function() {
   return jspb.Message.getField(this, 2) != null;
@@ -250,20 +297,27 @@ proto.SeriesMetadata.prototype.getCoverPhoto = function() {
 };
 
 
-/** @param {number} value */
+/**
+ * @param {number} value
+ * @return {!proto.SeriesMetadata} returns this
+ */
 proto.SeriesMetadata.prototype.setCoverPhoto = function(value) {
-  jspb.Message.setField(this, 3, value);
+  return jspb.Message.setField(this, 3, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.SeriesMetadata} returns this
+ */
 proto.SeriesMetadata.prototype.clearCoverPhoto = function() {
-  jspb.Message.setField(this, 3, undefined);
+  return jspb.Message.setField(this, 3, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.SeriesMetadata.prototype.hasCoverPhoto = function() {
   return jspb.Message.getField(this, 3) != null;
@@ -279,44 +333,35 @@ proto.SeriesMetadata.prototype.getPersonsList = function() {
 };
 
 
-/** @param {!Array<number>} value */
+/**
+ * @param {!Array<number>} value
+ * @return {!proto.SeriesMetadata} returns this
+ */
 proto.SeriesMetadata.prototype.setPersonsList = function(value) {
-  jspb.Message.setField(this, 4, value || []);
+  return jspb.Message.setField(this, 4, value || []);
 };
 
 
 /**
- * @param {!number} value
+ * @param {number} value
  * @param {number=} opt_index
+ * @return {!proto.SeriesMetadata} returns this
  */
 proto.SeriesMetadata.prototype.addPersons = function(value, opt_index) {
-  jspb.Message.addToRepeatedField(this, 4, value, opt_index);
+  return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
 };
 
 
+/**
+ * Clears the list making it empty but non-null.
+ * @return {!proto.SeriesMetadata} returns this
+ */
 proto.SeriesMetadata.prototype.clearPersonsList = function() {
-  this.setPersonsList([]);
+  return this.setPersonsList([]);
 };
 
 
 
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.SeasonMetadata = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, proto.SeasonMetadata.repeatedFields_, null);
-};
-goog.inherits(proto.SeasonMetadata, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.SeasonMetadata.displayName = 'proto.SeasonMetadata';
-}
 /**
  * List of repeated fields within this message type.
  * @private {!Array<number>}
@@ -328,13 +373,15 @@ proto.SeasonMetadata.repeatedFields_ = [4];
 
 if (jspb.Message.GENERATE_TO_OBJECT) {
 /**
- * Creates an object representation of this proto suitable for use in Soy templates.
+ * Creates an object representation of this proto.
  * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
  * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
  * @return {!Object}
  */
 proto.SeasonMetadata.prototype.toObject = function(opt_includeInstance) {
@@ -344,8 +391,8 @@ proto.SeasonMetadata.prototype.toObject = function(opt_includeInstance) {
 
 /**
  * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
  *     http://goto/soy-param-migration
  * @param {!proto.SeasonMetadata} msg The msg instance to transform.
  * @return {!Object}
@@ -353,10 +400,10 @@ proto.SeasonMetadata.prototype.toObject = function(opt_includeInstance) {
  */
 proto.SeasonMetadata.toObject = function(includeInstance, msg) {
   var f, obj = {
-    title: jspb.Message.getField(msg, 1),
-    description: jspb.Message.getField(msg, 2),
-    coverPhoto: jspb.Message.getField(msg, 3),
-    personsList: jspb.Message.getRepeatedField(msg, 4)
+    title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    description: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
+    coverPhoto: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
+    personsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f
   };
 
   if (includeInstance) {
@@ -406,8 +453,10 @@ proto.SeasonMetadata.deserializeBinaryFromReader = function(msg, reader) {
       msg.setCoverPhoto(value);
       break;
     case 4:
-      var value = /** @type {!Array<number>} */ (reader.readPackedUint64());
-      msg.setPersonsList(value);
+      var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]);
+      for (var i = 0; i < values.length; i++) {
+        msg.addPersons(values[i]);
+      }
       break;
     default:
       reader.skipField();
@@ -478,20 +527,27 @@ proto.SeasonMetadata.prototype.getTitle = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.SeasonMetadata} returns this
+ */
 proto.SeasonMetadata.prototype.setTitle = function(value) {
-  jspb.Message.setField(this, 1, value);
+  return jspb.Message.setField(this, 1, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.SeasonMetadata} returns this
+ */
 proto.SeasonMetadata.prototype.clearTitle = function() {
-  jspb.Message.setField(this, 1, undefined);
+  return jspb.Message.setField(this, 1, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.SeasonMetadata.prototype.hasTitle = function() {
   return jspb.Message.getField(this, 1) != null;
@@ -507,20 +563,27 @@ proto.SeasonMetadata.prototype.getDescription = function() {
 };
 
 
-/** @param {string} value */
+/**
+ * @param {string} value
+ * @return {!proto.SeasonMetadata} returns this
+ */
 proto.SeasonMetadata.prototype.setDescription = function(value) {
-  jspb.Message.setField(this, 2, value);
+  return jspb.Message.setField(this, 2, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.SeasonMetadata} returns this
+ */
 proto.SeasonMetadata.prototype.clearDescription = function() {
-  jspb.Message.setField(this, 2, undefined);
+  return jspb.Message.setField(this, 2, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.SeasonMetadata.prototype.hasDescription = function() {
   return jspb.Message.getField(this, 2) != null;
@@ -536,20 +599,27 @@ proto.SeasonMetadata.prototype.getCoverPhoto = function() {
 };
 
 
-/** @param {number} value */
+/**
+ * @param {number} value
+ * @return {!proto.SeasonMetadata} returns this
+ */
 proto.SeasonMetadata.prototype.setCoverPhoto = function(value) {
-  jspb.Message.setField(this, 3, value);
+  return jspb.Message.setField(this, 3, value);
 };
 
 
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.SeasonMetadata} returns this
+ */
 proto.SeasonMetadata.prototype.clearCoverPhoto = function() {
-  jspb.Message.setField(this, 3, undefined);
+  return jspb.Message.setField(this, 3, undefined);
 };
 
 
 /**
  * Returns whether this field is set.
- * @return {!boolean}
+ * @return {boolean}
  */
 proto.SeasonMetadata.prototype.hasCoverPhoto = function() {
   return jspb.Message.getField(this, 3) != null;
@@ -565,23 +635,31 @@ proto.SeasonMetadata.prototype.getPersonsList = function() {
 };
 
 
-/** @param {!Array<number>} value */
+/**
+ * @param {!Array<number>} value
+ * @return {!proto.SeasonMetadata} returns this
+ */
 proto.SeasonMetadata.prototype.setPersonsList = function(value) {
-  jspb.Message.setField(this, 4, value || []);
+  return jspb.Message.setField(this, 4, value || []);
 };
 
 
 /**
- * @param {!number} value
+ * @param {number} value
  * @param {number=} opt_index
+ * @return {!proto.SeasonMetadata} returns this
  */
 proto.SeasonMetadata.prototype.addPersons = function(value, opt_index) {
-  jspb.Message.addToRepeatedField(this, 4, value, opt_index);
+  return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
 };
 
 
+/**
+ * Clears the list making it empty but non-null.
+ * @return {!proto.SeasonMetadata} returns this
+ */
 proto.SeasonMetadata.prototype.clearPersonsList = function() {
-  this.setPersonsList([]);
+  return this.setPersonsList([]);
 };
 
 

File diff suppressed because it is too large
+ 360 - 178
content-metadata-protobuf/compiled/proto/Video_pb.js


+ 0 - 2
content-metadata-protobuf/proto/Channel.proto

@@ -1,7 +1,5 @@
 syntax = "proto2";
 
-package muthu.other;
-
 message ChannelMetadata {
     // Channel Title
     optional string title = 1;

+ 1 - 1
node/Cargo.toml

@@ -3,7 +3,7 @@ authors = ['Joystream contributors']
 build = 'build.rs'
 edition = '2018'
 name = 'joystream-node'
-version = '3.7.1'
+version = '3.7.2'
 default-run = "joystream-node"
 
 [[bin]]

+ 4 - 4
pioneer/packages/joy-proposals/src/validationSchema.ts

@@ -32,8 +32,8 @@ const RATIONALE_MAX_LENGTH = 3000;
 const FILE_SIZE_BYTES_MIN = 1;
 
 // Set Election Parameters
-const ANNOUNCING_PERIOD_MAX = 43200;
 const ANNOUNCING_PERIOD_MIN = 14400;
+const ANNOUNCING_PERIOD_MAX = 43200;
 const VOTING_PERIOD_MIN = 14400;
 const VOTING_PERIOD_MAX = 28800;
 const REVEALING_PERIOD_MIN = 14400;
@@ -42,10 +42,10 @@ const MIN_COUNCIL_STAKE_MIN = 1;
 const MIN_COUNCIL_STAKE_MAX = 100000;
 const NEW_TERM_DURATION_MIN = 14400;
 const NEW_TERM_DURATION_MAX = 432000;
-const CANDIDACY_LIMIT_MIN = 25;
+const CANDIDACY_LIMIT_MIN = 50;
 const CANDIDACY_LIMIT_MAX = 100;
-const COUNCIL_SIZE_MAX = 20;
 const COUNCIL_SIZE_MIN = 4;
+const COUNCIL_SIZE_MAX = 20;
 const MIN_VOTING_STAKE_MIN = 1;
 const MIN_VOTING_STAKE_MAX = 100000;
 
@@ -55,7 +55,7 @@ const TOKENS_MAX = 5000000;
 
 // Set Validator Count
 const MAX_VALIDATOR_COUNT_MIN = 4;
-const MAX_VALIDATOR_COUNT_MAX = 100;
+const MAX_VALIDATOR_COUNT_MAX = 300;
 
 // Add Working Group Leader Opening Parameters
 // TODO: Discuss the actual values

+ 2 - 2
runtime-modules/proposals/codex/src/lib.rs

@@ -85,13 +85,13 @@ const WORKING_GROUP_MINT_CAPACITY_MAX_VALUE: u32 = 5_000_000;
 // Max allowed value for 'spending' proposal
 const MAX_SPENDING_PROPOSAL_VALUE: u32 = 5_000_000_u32;
 // Max validator count for the 'set validator count' proposal
-const MAX_VALIDATOR_COUNT: u32 = 100;
+const MAX_VALIDATOR_COUNT: u32 = 300;
 // council_size min value for the 'set election parameters' proposal
 const ELECTION_PARAMETERS_COUNCIL_SIZE_MIN_VALUE: u32 = 4;
 // council_size max value for the 'set election parameters' proposal
 const ELECTION_PARAMETERS_COUNCIL_SIZE_MAX_VALUE: u32 = 20;
 // candidacy_limit min value for the 'set election parameters' proposal
-const ELECTION_PARAMETERS_CANDIDACY_LIMIT_MIN_VALUE: u32 = 25;
+const ELECTION_PARAMETERS_CANDIDACY_LIMIT_MIN_VALUE: u32 = 50;
 // candidacy_limit max value for the 'set election parameters' proposal
 const ELECTION_PARAMETERS_CANDIDACY_LIMIT_MAX_VALUE: u32 = 100;
 // min_voting_stake min value for the 'set election parameters' proposal

+ 1 - 1
runtime-modules/proposals/codex/src/proposal_types/mod.rs

@@ -317,7 +317,7 @@ impl Default for ProposalsConfigParameters {
             set_validator_count_proposal_voting_period: 43200u32,
             set_validator_count_proposal_grace_period: 0u32,
             runtime_upgrade_proposal_voting_period: 72000u32,
-            runtime_upgrade_proposal_grace_period: 72000u32,
+            runtime_upgrade_proposal_grace_period: 28800u32,
             text_proposal_voting_period: 72000u32,
             text_proposal_grace_period: 0u32,
             set_election_parameters_proposal_voting_period: 72000u32,

+ 3 - 3
runtime-modules/proposals/codex/src/proposal_types/parameters.rs

@@ -10,7 +10,7 @@ pub(crate) fn set_validator_count_proposal<T: crate::Trait>(
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(<BalanceOf<T>>::from(100_000_u32)),
+        required_stake: Some(<BalanceOf<T>>::from(500_000_u32)),
     }
 }
 
@@ -24,7 +24,7 @@ pub(crate) fn runtime_upgrade_proposal<T: crate::Trait>(
         approval_threshold_percentage: 100,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(<BalanceOf<T>>::from(1_000_000_u32)),
+        required_stake: Some(<BalanceOf<T>>::from(5_000_000_u32)),
     }
 }
 
@@ -51,7 +51,7 @@ pub(crate) fn set_election_parameters_proposal<T: crate::Trait>(
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(<BalanceOf<T>>::from(200_000_u32)),
+        required_stake: Some(<BalanceOf<T>>::from(1_000_000_u32)),
     }
 }
 

+ 8 - 8
runtime-modules/proposals/codex/src/tests/mod.rs

@@ -187,7 +187,7 @@ fn create_text_proposal_codex_call_fails_with_incorrect_text_size() {
 #[test]
 fn create_runtime_upgrade_common_checks_succeed() {
     initial_test_ext().execute_with(|| {
-        increase_total_balance_issuance_using_account_id(1, 5000000);
+        increase_total_balance_issuance_using_account_id(1, 10000000);
 
         let proposal_fixture = ProposalTestFixture {
             insufficient_rights_call: || {
@@ -226,7 +226,7 @@ fn create_runtime_upgrade_common_checks_succeed() {
                     1,
                     b"title".to_vec(),
                     b"body".to_vec(),
-                    Some(<BalanceOf<Test>>::from(1_000_000_u32)),
+                    Some(<BalanceOf<Test>>::from(5_000_000_u32)),
                     b"wasm".to_vec(),
                 )
             },
@@ -272,7 +272,7 @@ fn create_upgrade_runtime_proposal_codex_call_fails_with_incorrect_wasm_size() {
 #[test]
 fn create_set_election_parameters_proposal_common_checks_succeed() {
     initial_test_ext().execute_with(|| {
-        increase_total_balance_issuance_using_account_id(1, 500000);
+        increase_total_balance_issuance_using_account_id(1, 2000000);
 
         let proposal_fixture = ProposalTestFixture {
             insufficient_rights_call: || {
@@ -311,7 +311,7 @@ fn create_set_election_parameters_proposal_common_checks_succeed() {
                     1,
                     b"title".to_vec(),
                     b"body".to_vec(),
-                    Some(<BalanceOf<Test>>::from(200_000_u32)),
+                    Some(<BalanceOf<Test>>::from(1_000_000_u32)),
                     get_valid_election_parameters(),
                 )
             },
@@ -348,7 +348,7 @@ fn get_valid_election_parameters() -> ElectionParameters<u64, u64> {
         voting_period: 14400,
         revealing_period: 14400,
         council_size: 4,
-        candidacy_limit: 25,
+        candidacy_limit: 50,
         new_term_duration: 14400,
         min_council_stake: 1,
         min_voting_stake: 1,
@@ -358,7 +358,7 @@ fn get_valid_election_parameters() -> ElectionParameters<u64, u64> {
 #[test]
 fn create_set_election_parameters_call_fails_with_incorrect_parameters() {
     initial_test_ext().execute_with(|| {
-        increase_total_balance_issuance_using_account_id(1, 500000);
+        increase_total_balance_issuance_using_account_id(1, 1500000);
 
         let mut election_parameters = get_valid_election_parameters();
         election_parameters.council_size = 2;
@@ -566,7 +566,7 @@ fn create_spending_proposal_call_fails_with_incorrect_balance() {
 #[test]
 fn create_set_validator_count_proposal_common_checks_succeed() {
     initial_test_ext().execute_with(|| {
-        increase_total_balance_issuance_using_account_id(1, 500000);
+        increase_total_balance_issuance_using_account_id(1, 1000000);
 
         let proposal_fixture = ProposalTestFixture {
             insufficient_rights_call: || {
@@ -605,7 +605,7 @@ fn create_set_validator_count_proposal_common_checks_succeed() {
                     1,
                     b"title".to_vec(),
                     b"body".to_vec(),
-                    Some(<BalanceOf<Test>>::from(100_000_u32)),
+                    Some(<BalanceOf<Test>>::from(500_000_u32)),
                     4,
                 )
             },

+ 1 - 1
runtime/Cargo.toml

@@ -4,7 +4,7 @@ edition = '2018'
 name = 'joystream-node-runtime'
 # Follow convention: https://github.com/Joystream/substrate-runtime-joystream/issues/1
 # {Authoring}.{Spec}.{Impl} of the RuntimeVersion
-version = '7.14.0'
+version = '7.15.0'
 
 [dependencies]
 # Third-party dependencies

+ 1 - 1
runtime/src/constants.rs

@@ -18,7 +18,7 @@ pub const MILLISECS_PER_BLOCK: Moment = 6000;
 pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000;
 
 pub const SLOT_DURATION: Moment = 6000;
-pub const BONDING_DURATION: u32 = 24;
+pub const BONDING_DURATION: u32 = 24 * 7;
 
 pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES;
 pub const EPOCH_DURATION_IN_SLOTS: u64 = {

+ 2 - 2
runtime/src/lib.rs

@@ -71,7 +71,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
     spec_name: create_runtime_str!("joystream-node"),
     impl_name: create_runtime_str!("joystream-node"),
     authoring_version: 7,
-    spec_version: 14,
+    spec_version: 15,
     impl_version: 0,
     apis: crate::runtime_api::EXPORTED_RUNTIME_API_VERSIONS,
     transaction_version: 1,
@@ -538,7 +538,7 @@ parameter_types! {
     pub const ProposalRejectionFee: u64 = 5000;
     pub const ProposalTitleMaxLength: u32 = 40;
     pub const ProposalDescriptionMaxLength: u32 = 3000;
-    pub const ProposalMaxActiveProposalLimit: u32 = 5;
+    pub const ProposalMaxActiveProposalLimit: u32 = 20;
 }
 
 impl proposals_engine::Trait for Runtime {

+ 4 - 4
runtime/src/tests/proposals_integration/mod.rs

@@ -513,7 +513,7 @@ where
             setup_members(NUMBER_OF_MEMBERS_TO_SETUP_IN_CODEX_PROPOSAL_FIXTURE);
             setup_council();
 
-            increase_total_balance_issuance_using_account_id(account_id.clone().into(), 500000);
+            increase_total_balance_issuance_using_account_id(account_id.clone().into(), 1000000);
         }
 
         assert_eq!((self.successful_call)(), Ok(()));
@@ -620,7 +620,7 @@ fn set_election_parameters_proposal_execution_succeeds() {
             voting_period: 14400,
             revealing_period: 14400,
             council_size: 4,
-            candidacy_limit: 25,
+            candidacy_limit: 50,
             new_term_duration: 14400,
             min_council_stake: 1,
             min_voting_stake: 1,
@@ -633,7 +633,7 @@ fn set_election_parameters_proposal_execution_succeeds() {
                 member_id as u64,
                 b"title".to_vec(),
                 b"body".to_vec(),
-                Some(<BalanceOf<Runtime>>::from(200_000_u32)),
+                Some(<BalanceOf<Runtime>>::from(1_000_000_u32)),
                 election_parameters,
             )
         });
@@ -658,7 +658,7 @@ fn set_validator_count_proposal_execution_succeeds() {
                 member_id as u64,
                 b"title".to_vec(),
                 b"body".to_vec(),
-                Some(<BalanceOf<Runtime>>::from(100_000_u32)),
+                Some(<BalanceOf<Runtime>>::from(500_000_u32)),
                 new_validator_count,
             )
         });

+ 4 - 0
testnets/joy-testnet-4.json

@@ -12,6 +12,10 @@
     [
       "/dns/telemetry.polkadot.io/tcp/443/x-parity-wss/%2Fsubmit%2F",
       0
+    ],
+    [
+      "/dns/telemetry.joystream.org/tcp/443/x-parity-wss/%2Fsubmit%2F",
+      0
     ]
   ],
   "protocolId": "/joy/testnet/4",

+ 16 - 12
tests/network-tests/src/fixtures/proposalsModule.ts

@@ -415,7 +415,7 @@ export class ElectionParametersProposalFixture extends BaseFixture {
   public async execute(): Promise<void> {
     // Setup
     const proposalTitle: string = 'Testing proposal ' + uuid().substring(0, 8)
-    const description: string = 'Testing validator count proposal ' + uuid().substring(0, 8)
+    const description: string = 'Testing Election Parameters proposal ' + uuid().substring(0, 8)
 
     const announcingPeriod: BN = new BN(28800)
     const votingPeriod: BN = new BN(14400)
@@ -428,7 +428,7 @@ export class ElectionParametersProposalFixture extends BaseFixture {
 
     // Proposal stake calculation
     // Required stake is hardcoded in runtime-module (but not available as const)
-    const proposalStake: BN = new BN(200000)
+    const proposalStake: BN = new BN(1000000)
     const proposalFee: BN = this.api.estimateProposeElectionParametersFee(
       description,
       description,
@@ -450,7 +450,9 @@ export class ElectionParametersProposalFixture extends BaseFixture {
     const proposedVotingPeriod: BN = votingPeriod.addn(1)
     const proposedRevealingPeriod: BN = revealingPeriod.addn(1)
     const proposedCouncilSize: BN = councilSize.addn(1)
-    const proposedCandidacyLimit: BN = candidacyLimit.addn(1)
+    const proposedCandidacyLimit: BN = new BN(51) // candidacyLimit.addn(1)
+    // assert they are different
+    assert(!candidacyLimit.eq(proposedCandidacyLimit))
     const proposedNewTermDuration: BN = newTermDuration.addn(1)
     const proposedMinCouncilStake: BN = minCouncilStake.addn(1)
     const proposedMinVotingStake: BN = minVotingStake.addn(1)
@@ -618,12 +620,12 @@ export class TextProposalFixture extends BaseFixture {
 
 export class ValidatorCountProposalFixture extends BaseFixture {
   private proposer: string
-  private validatorCountIncrement: BN
+  private proposedValidatorCount: BN
 
-  constructor(api: Api, proposer: string, validatorCountIncrement: BN) {
+  constructor(api: Api, proposer: string, validatorCount: BN) {
     super(api)
     this.proposer = proposer
-    this.validatorCountIncrement = validatorCountIncrement
+    this.proposedValidatorCount = validatorCount
   }
 
   public async execute(): Promise<void> {
@@ -632,19 +634,21 @@ export class ValidatorCountProposalFixture extends BaseFixture {
     const description: string = 'Testing validator count proposal ' + uuid().substring(0, 8)
 
     // Proposal stake calculation
-    const proposalStake: BN = new BN(100000)
+    const proposalStake: BN = new BN(500000)
     const proposalFee: BN = this.api.estimateProposeValidatorCountFee(description, description, proposalStake)
     this.api.treasuryTransferBalance(this.proposer, proposalFee.add(proposalStake))
-    const validatorCount: BN = await this.api.getValidatorCount()
+    const currentValidatorCount: BN = await this.api.getValidatorCount()
 
     // Proposal creation
-    const proposedValidatorCount: BN = validatorCount.add(this.validatorCountIncrement)
+    // Make sure proposed is different than current to ensure change is applied.
+    assert(!currentValidatorCount.eq(this.proposedValidatorCount))
+
     const result = await this.api.proposeValidatorCount(
       this.proposer,
       proposalTitle,
       description,
       proposalStake,
-      proposedValidatorCount
+      this.proposedValidatorCount
     )
     const proposalNumber: ProposalId = this.api.findProposalCreatedEvent(result.events) as ProposalId
     assert.notEqual(proposalNumber, undefined)
@@ -656,8 +660,8 @@ export class ValidatorCountProposalFixture extends BaseFixture {
 
     const newValidatorCount: BN = await this.api.getValidatorCount()
     assert(
-      proposedValidatorCount.eq(newValidatorCount),
-      `Validator count has unexpeccted value ${newValidatorCount}, expected ${proposedValidatorCount}`
+      this.proposedValidatorCount.eq(newValidatorCount),
+      `Validator count has unexpeccted value ${newValidatorCount}, expected ${this.proposedValidatorCount}`
     )
   }
 }

+ 3 - 4
tests/network-tests/src/flows/proposals/validatorCountProposal.ts

@@ -6,7 +6,7 @@ import { FixtureRunner } from '../../Fixture'
 import Debugger from 'debug'
 import { Resource } from '../../Resources'
 
-export default async function validatorCount({ api, env, lock }: FlowProps): Promise<void> {
+export default async function validatorCount({ api, lock }: FlowProps): Promise<void> {
   const debug = Debugger('flow:validatorCountProposal')
   debug('Started')
   await lock(Resource.Proposals)
@@ -16,13 +16,12 @@ export default async function validatorCount({ api, env, lock }: FlowProps): Pro
   assert(council.length)
 
   const proposer = council[0].member.toString()
-
-  const validatorCountIncrement: BN = new BN(+env.VALIDATOR_COUNT_INCREMENT!)
+  const proposedValidatorCount = new BN(300)
 
   const validatorCountProposalFixture: ValidatorCountProposalFixture = new ValidatorCountProposalFixture(
     api,
     proposer,
-    validatorCountIncrement
+    proposedValidatorCount
   )
   await new FixtureRunner(validatorCountProposalFixture).run()
 

+ 20 - 36
yarn.lock

@@ -9118,19 +9118,6 @@ cli-cursor@^3.1.0:
   dependencies:
     restore-cursor "^3.1.0"
 
-<<<<<<< HEAD
-cli-highlight@^2.1.4:
-  version "2.1.4"
-  resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.4.tgz#098cb642cf17f42adc1c1145e07f960ec4d7522b"
-  integrity sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==
-  dependencies:
-    chalk "^3.0.0"
-    highlight.js "^9.6.0"
-    mz "^2.4.0"
-    parse5 "^5.1.1"
-    parse5-htmlparser2-tree-adapter "^5.1.1"
-    yargs "^15.0.0"
-=======
 cli-highlight@^2.1.10:
   version "2.1.10"
   resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.10.tgz#26a087da9209dce4fcb8cf5427dc97cd96ac173a"
@@ -9142,7 +9129,6 @@ cli-highlight@^2.1.10:
     parse5 "^5.1.1"
     parse5-htmlparser2-tree-adapter "^6.0.0"
     yargs "^16.0.0"
->>>>>>> 61a854817e3fdf569f4e993d854a0ef2b89cad4c
 
 cli-progress@^3.4.0:
   version "3.8.2"
@@ -22247,21 +22233,12 @@ parse-url@^5.0.0:
     parse-path "^4.0.0"
     protocols "^1.4.0"
 
-<<<<<<< HEAD
-parse5-htmlparser2-tree-adapter@^5.1.1:
-  version "5.1.1"
-  resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz#e8c743d4e92194d5293ecde2b08be31e67461cbc"
-  integrity sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==
-  dependencies:
-    parse5 "^5.1.1"
-=======
 parse5-htmlparser2-tree-adapter@^6.0.0:
   version "6.0.1"
   resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6"
   integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==
   dependencies:
     parse5 "^6.0.1"
->>>>>>> 61a854817e3fdf569f4e993d854a0ef2b89cad4c
 
 parse5@4.0.0:
   version "4.0.0"
@@ -22273,6 +22250,11 @@ parse5@5.1.1, parse5@^5.0.0, parse5@^5.1.1:
   resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178"
   integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==
 
+parse5@^6.0.1:
+  version "6.0.1"
+  resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b"
+  integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==
+
 parseurl@^1.3.2, parseurl@^1.3.3, parseurl@~1.3.2, parseurl@~1.3.3:
   version "1.3.3"
   resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
@@ -28139,27 +28121,16 @@ typeorm-typedi-extensions@^0.2.3:
   resolved "https://registry.yarnpkg.com/typeorm-typedi-extensions/-/typeorm-typedi-extensions-0.2.3.tgz#94fca2656206d771bf6d2242f5aab570511188e8"
   integrity sha512-T9i1NvRZNjPn9Jb8oT772ihfn6PwdqDVpzPCtKSqjkZGOgXrCkdyD3dDrzfMaoWJ1afU58bVx2CMb95FzT42Ow==
 
-<<<<<<< HEAD
-typeorm@^0.2.25:
-  version "0.2.29"
-  resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.2.29.tgz#401289dc91900d72eccb26e31cdb7f0591a2272e"
-  integrity sha512-ih1vrTe3gEAGKRcWlcsTRxTL7gNjacQE498wVGuJ3ZRujtMqPZlbAWuC7xDzWCRjQnkZYNwZQeG9UgKfxSHB5g==
-=======
 typeorm@^0.2.25, typeorm@^0.2.31:
   version "0.2.31"
   resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.2.31.tgz#82b8a1b233224f81c738f53b0380386ccf360917"
   integrity sha512-dVvCEVHH48DG0QPXAKfo0l6ecQrl3A8ucGP4Yw4myz4YEDMProebTQo8as83uyES+nrwCbu3qdkL4ncC2+qcMA==
->>>>>>> 61a854817e3fdf569f4e993d854a0ef2b89cad4c
   dependencies:
     "@sqltools/formatter" "1.2.2"
     app-root-path "^3.0.0"
     buffer "^5.5.0"
     chalk "^4.1.0"
-<<<<<<< HEAD
-    cli-highlight "^2.1.4"
-=======
     cli-highlight "^2.1.10"
->>>>>>> 61a854817e3fdf569f4e993d854a0ef2b89cad4c
     debug "^4.1.1"
     dotenv "^8.2.0"
     glob "^7.1.6"
@@ -29904,7 +29875,7 @@ y18n@^3.2.1:
   resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
   integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
 
-y18n@^5.0.2:
+y18n@^5.0.2, y18n@^5.0.5:
   version "5.0.5"
   resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18"
   integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==
@@ -30146,6 +30117,19 @@ yargs@^15.0.1, yargs@^15.3.1, yargs@^15.4.1:
     y18n "^4.0.0"
     yargs-parser "^18.1.2"
 
+yargs@^16.0.0:
+  version "16.2.0"
+  resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
+  integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
+  dependencies:
+    cliui "^7.0.2"
+    escalade "^3.1.1"
+    get-caller-file "^2.0.5"
+    require-directory "^2.1.1"
+    string-width "^4.2.0"
+    y18n "^5.0.5"
+    yargs-parser "^20.2.2"
+
 yargs@^16.0.3:
   version "16.1.0"
   resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.1.0.tgz#fc333fe4791660eace5a894b39d42f851cd48f2a"
@@ -30242,4 +30226,4 @@ zen-observable@^0.8.0, zen-observable@^0.8.14:
 zepto@^1.2.0:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/zepto/-/zepto-1.2.0.tgz#e127bd9e66fd846be5eab48c1394882f7c0e4f98"
-  integrity sha1-4Se9nmb9hGvl6rSME5SIL3wOT5g=
+  integrity sha1-4Se9nmb9hGvl6rSME5SIL3wOT5g=

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