Эх сурвалжийг харах

Content directory cli query fixes

iorveth 4 жил өмнө
parent
commit
a3e6b2d969

+ 1 - 1
cli/src/Api.ts

@@ -59,7 +59,7 @@ const DEFAULT_DECIMALS = new BN(12)
 // Mapping of working group to api module
 export const apiModuleByGroup: { [key in WorkingGroups]: string } = {
   [WorkingGroups.StorageProviders]: 'storageWorkingGroup',
-  [WorkingGroups.Curators]: 'contentWorkingGroup',
+  [WorkingGroups.Curators]: 'contentDirectoryWorkingGroup',
   [WorkingGroups.Builder]: 'builderWorkingGroup',
   [WorkingGroups.Gateway]: 'gatewayWorkingGroup',
 }

+ 1 - 1
cli/src/commands/content/addCuratorToGroup.ts

@@ -35,7 +35,7 @@ export default class AddCuratorToGroupCommand extends ContentDirectoryCommandBas
     }
 
     await this.requestAccountDecoding(account)
-    await this.sendAndFollowNamedTx(account, 'contentDirectory', 'addCuratorToGroup', [groupId, curatorId])
+    await this.sendAndFollowNamedTx(account, 'content', 'addCuratorToGroup', [groupId, curatorId])
 
     console.log(chalk.green(`Curator ${chalk.white(curatorId)} succesfully added to group ${chalk.white(groupId)}!`))
   }

+ 1 - 1
cli/src/commands/content/createChannel.ts

@@ -60,7 +60,7 @@ export default class CreateChannelCommand extends ContentDirectoryCommandBase {
       if (confirmed)  {
         this.log('Sending the extrinsic...')
 
-        await this.sendAndFollowNamedTx(currentAccount, 'contentDirectory', 'createChannel', [actor, channelCreationParametersInput])
+        await this.sendAndFollowNamedTx(currentAccount, 'content', 'createChannel', [actor, channelCreationParametersInput])
 
       }
     } else {

+ 1 - 1
cli/src/commands/content/createCuratorGroup.ts

@@ -10,7 +10,7 @@ export default class AddCuratorGroupCommand extends ContentDirectoryCommandBase
     await this.requireLead()
 
     await this.requestAccountDecoding(account)
-    await this.buildAndSendExtrinsic(account, 'contentDirectory', 'addCuratorGroup')
+    await this.buildAndSendExtrinsic(account, 'content', 'addCuratorGroup')
 
     const newGroupId = (await this.getApi().nextCuratorGroupId()) - 1
     console.log(chalk.green(`New group succesfully created! (ID: ${chalk.white(newGroupId)})`))

+ 1 - 1
cli/src/commands/content/removeCuratorFromGroup.ts

@@ -39,7 +39,7 @@ export default class RemoveCuratorFromGroupCommand extends ContentDirectoryComma
     }
 
     await this.requestAccountDecoding(account)
-    await this.sendAndFollowNamedTx(account, 'contentDirectory', 'removeCuratorFromGroup', [groupId, curatorId])
+    await this.sendAndFollowNamedTx(account, 'content', 'removeCuratorFromGroup', [groupId, curatorId])
 
     this.log(chalk.green(`Curator ${chalk.white(curatorId)} successfully removed from group ${chalk.white(groupId)}!`))
   }

+ 1 - 1
cli/src/commands/content/removeCuratorGroup.ts

@@ -21,7 +21,7 @@ export default class RemoveCuratorGroupCommand extends ContentDirectoryCommandBa
     }
 
     await this.requestAccountDecoding(account)
-    await this.sendAndFollowNamedTx(account, 'contentDirectory', 'removeCuratorGroup', [id])
+    await this.sendAndFollowNamedTx(account, 'content', 'removeCuratorGroup', [id])
 
     console.log(chalk.green(`Curator Group ${chalk.white(id)} succesfully removed!`))
   }

+ 1 - 1
cli/src/commands/content/setCuratorGroupStatus.ts

@@ -48,7 +48,7 @@ export default class SetCuratorGroupStatusCommand extends ContentDirectoryComman
     }
 
     await this.requestAccountDecoding(account)
-    await this.sendAndFollowNamedTx(account, 'contentDirectory', 'setCuratorGroupStatus', [id, status])
+    await this.sendAndFollowNamedTx(account, 'content', 'setCuratorGroupStatus', [id, status])
 
     console.log(
       chalk.green(

+ 1 - 1
tests/network-tests/src/Api.ts

@@ -1730,7 +1730,7 @@ export class Api {
   }
 
   async sendContentDirectoryTransaction(operations: OperationType[]): Promise<ISubmittableResult> {
-    const transaction = this.api.tx.contentDirectory.transaction(
+    const transaction = this.api.tx.content.transaction(
       { Lead: null }, // We use member with id 0 as actor (in this case we assume this is Alice)
       operations // We provide parsed operations as second argument
     )

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

@@ -168,7 +168,7 @@ export class PersonActor extends JoyEnum({
   Curator: CuratorId,
 }) {}
 
-export const contentDirectoryTypes = {
+export const contentTypes = {
   CuratorId,
   CuratorGroupId,
   CuratorGroup,
@@ -211,4 +211,4 @@ export const contentDirectoryTypes = {
   MaxNumber,
 }
 
-export default contentDirectoryTypes
+export default contentTypes

+ 3 - 3
types/src/index.ts

@@ -12,7 +12,7 @@ import workingGroup from './working-group'
 import discovery from './discovery'
 import storage from './storage'
 import proposals from './proposals'
-import contentDirectory from './content'
+import content from './content'
 import legacy from './legacy'
 import { InterfaceTypes } from '@polkadot/types/types/registry'
 import { TypeRegistry, Text, UInt, Null, bool, Option, Vec, BTreeSet, BTreeMap } from '@polkadot/types'
@@ -34,7 +34,7 @@ export {
   discovery,
   storage,
   proposals,
-  contentDirectory,
+  content,
 }
 
 export const types: RegistryTypes = {
@@ -53,7 +53,7 @@ export const types: RegistryTypes = {
   ...discovery,
   ...storage,
   ...proposals,
-  ...contentDirectory,
+  ...content,
 }
 
 // Allows creating types without api instance (it's not a recommended way though, so should be used just for mocks)

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

@@ -21,7 +21,7 @@ import workingGroup from '../working-group'
 import discovery from '../discovery'
 import storage from '../storage'
 import proposals from '../proposals'
-import contentDirectory from '../content'
+import content from '../content'
 import legacy from '../legacy'
 
 const AUGMENT_INTERFACES_PATH = path.join(__dirname, '../../augment')
@@ -44,7 +44,7 @@ const typesByModule = {
   'discovery': discovery,
   'storage': storage,
   'proposals': proposals,
-  'content': contentDirectory,
+  'content': content,
 }
 
 type Imports = { [moduleName: string]: string[] }