Procházet zdrojové kódy

Add ReplyToDelete and RewardPaymentType

Leszek Wiesner před 3 roky
rodič
revize
7b9654f49b

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 2
types/augment-codec/all.ts


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

@@ -4,7 +4,7 @@
 import { AnyNumber, ITuple } from '@polkadot/types/types';
 import { BTreeMap, BTreeSet, Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64, u8 } from '@polkadot/types/primitive';
-import { Actor, ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, ClassId, ClassPermissions, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, EntityController, EntityId, EntryId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InputPropertyValue, InputValue, InviteMembershipParameters, MemberId, MemoText, ModeratorId, Nonce, OpeningId, OpeningType, OperationType, OracleJudgment, ParticipantId, Poll, PostId, PostReactionId, PrivilegedActor, Property, PropertyId, ProposalDetailsOf, ProposalId, ReplyId, SchemaId, StakePolicy, StorageProviderId, ThreadId, ThreadMode, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
+import { Actor, ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, ClassId, ClassPermissions, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, EntityController, EntityId, EntryId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InputPropertyValue, InputValue, InviteMembershipParameters, MemberId, MemoText, ModeratorId, Nonce, OpeningId, OpeningType, OperationType, OracleJudgment, ParticipantId, Poll, PostId, PostReactionId, PrivilegedActor, Property, PropertyId, ProposalDetailsOf, ProposalId, ReplyId, ReplyToDelete, SchemaId, StakePolicy, StorageProviderId, ThreadId, ThreadMode, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
 import { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
 import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
@@ -146,7 +146,20 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      createReply: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, replyId: Option<ReplyId> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createReply: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, replyId: Option<ReplyId> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array, editable: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove reply from storage
+       * 
+       * <weight>
+       * 
+       * ## Weight
+       * `O (R)` where
+       * - R is the number of replies to be deleted
+       * - DB:
+       * - O(R)
+       * # </weight>
+       **/
+      deleteReplies: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, replies: Vec<ReplyToDelete> | (ReplyToDelete | { post_id?: any; reply_id?: any; hide?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
       /**
        * Blog owner can edit post, related to a given blog (if unlocked)
        * with a new title and/or body
@@ -1054,19 +1067,6 @@ declare module '@polkadot/api/types/submittable' {
        * # </weight>
        **/
       updateCategoryMembershipOfModerator: AugmentedSubmittable<(moderatorId: ModeratorId | AnyNumber | Uint8Array, categoryId: CategoryId | AnyNumber | Uint8Array, newValue: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
-      /**
-       * Update thread archival status
-       * 
-       * <weight>
-       * 
-       * ## Weight
-       * `O (W)` where:
-       * - `W` is the category depth
-       * - DB:
-       * - O(W)
-       * # </weight>
-       **/
-      updateThreadArchivalStatus: AugmentedSubmittable<(actor: PrivilegedActor | { Lead: any } | { Moderator: any } | string | Uint8Array, categoryId: CategoryId | AnyNumber | Uint8Array, threadId: ThreadId | AnyNumber | Uint8Array, newArchivalStatus: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Submit a poll
        * 

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
types/augment-codec/augment-types.ts


+ 11 - 0
types/augment/all/defs.json

@@ -208,6 +208,12 @@
         "slashing_text": "Text",
         "slashing_amount": "u128"
     },
+    "RewardPaymentType": {
+        "_enum": [
+            "MissedReward",
+            "RegularReward"
+        ]
+    },
     "Url": "Text",
     "IPNSIdentity": "Text",
     "ServiceProviderRecord": {
@@ -253,6 +259,11 @@
         "owner": "ParticipantId",
         "parent_id": "PostId"
     },
+    "ReplyToDelete": {
+        "post_id": "PostId",
+        "reply_id": "ReplyId",
+        "hide": "bool"
+    },
     "ProposalId": "u32",
     "ProposalStatus": {
         "_enum": {

+ 13 - 0
types/augment/all/types.ts

@@ -866,6 +866,19 @@ export interface Reply extends Struct {
 /** @name ReplyId */
 export interface ReplyId extends u64 {}
 
+/** @name ReplyToDelete */
+export interface ReplyToDelete extends Struct {
+  readonly post_id: PostId;
+  readonly reply_id: ReplyId;
+  readonly hide: bool;
+}
+
+/** @name RewardPaymentType */
+export interface RewardPaymentType extends Enum {
+  readonly isMissedReward: boolean;
+  readonly isRegularReward: boolean;
+}
+
 /** @name SameController */
 export interface SameController extends bool {}
 

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

@@ -4,7 +4,7 @@
 import { AnyNumber, ITuple } from '@polkadot/types/types';
 import { BTreeMap, BTreeSet, Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64, u8 } from '@polkadot/types/primitive';
-import { Actor, ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, ClassId, ClassPermissions, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, EntityController, EntityId, EntryId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InputPropertyValue, InputValue, InviteMembershipParameters, MemberId, MemoText, ModeratorId, Nonce, OpeningId, OpeningType, OperationType, OracleJudgment, ParticipantId, Poll, PostId, PostReactionId, PrivilegedActor, Property, PropertyId, ProposalDetailsOf, ProposalId, ReplyId, SchemaId, StakePolicy, StorageProviderId, ThreadId, ThreadMode, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
+import { Actor, ActorId, ApplicationId, ApplyOnOpeningParameters, BalanceKind, BountyActor, BountyCreationParameters, BountyId, BuyMembershipParameters, CategoryId, ClassId, ClassPermissions, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, EntityController, EntityId, EntryId, ForumUserId, FundingRequestParameters, GeneralProposalParameters, InputPropertyValue, InputValue, InviteMembershipParameters, MemberId, MemoText, ModeratorId, Nonce, OpeningId, OpeningType, OperationType, OracleJudgment, ParticipantId, Poll, PostId, PostReactionId, PrivilegedActor, Property, PropertyId, ProposalDetailsOf, ProposalId, ReplyId, ReplyToDelete, SchemaId, StakePolicy, StorageProviderId, ThreadId, ThreadMode, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
 import { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
 import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
@@ -146,7 +146,20 @@ declare module '@polkadot/api/types/submittable' {
        * - O(1) doesn't depend on the state or parameters
        * # </weight>
        **/
-      createReply: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, replyId: Option<ReplyId> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createReply: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, replyId: Option<ReplyId> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array, editable: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove reply from storage
+       * 
+       * <weight>
+       * 
+       * ## Weight
+       * `O (R)` where
+       * - R is the number of replies to be deleted
+       * - DB:
+       * - O(R)
+       * # </weight>
+       **/
+      deleteReplies: AugmentedSubmittable<(participantId: ParticipantId | AnyNumber | Uint8Array, replies: Vec<ReplyToDelete> | (ReplyToDelete | { post_id?: any; reply_id?: any; hide?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
       /**
        * Blog owner can edit post, related to a given blog (if unlocked)
        * with a new title and/or body
@@ -1054,19 +1067,6 @@ declare module '@polkadot/api/types/submittable' {
        * # </weight>
        **/
       updateCategoryMembershipOfModerator: AugmentedSubmittable<(moderatorId: ModeratorId | AnyNumber | Uint8Array, categoryId: CategoryId | AnyNumber | Uint8Array, newValue: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
-      /**
-       * Update thread archival status
-       * 
-       * <weight>
-       * 
-       * ## Weight
-       * `O (W)` where:
-       * - `W` is the category depth
-       * - DB:
-       * - O(W)
-       * # </weight>
-       **/
-      updateThreadArchivalStatus: AugmentedSubmittable<(actor: PrivilegedActor | { Lead: any } | { Moderator: any } | string | Uint8Array, categoryId: CategoryId | AnyNumber | Uint8Array, threadId: ThreadId | AnyNumber | Uint8Array, newArchivalStatus: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Submit a poll
        * 

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
types/augment/augment-types.ts


+ 8 - 1
types/src/blog.ts

@@ -1,5 +1,5 @@
 import { JoyStructDecorated, MemberId, Hash, PostId } from './common'
-import { Text, Option, u64 } from '@polkadot/types'
+import { Text, Option, u64, bool } from '@polkadot/types'
 
 export class ParticipantId extends MemberId {}
 export class Title extends Text {}
@@ -13,6 +13,12 @@ export class Reply extends JoyStructDecorated({
   parent_id: PostId,
 }) {}
 
+export class ReplyToDelete extends JoyStructDecorated({
+  post_id: PostId,
+  reply_id: ReplyId,
+  hide: bool,
+}) {}
+
 export default {
   ParticipantId,
   Title,
@@ -20,4 +26,5 @@ export default {
   UpdatedBody,
   ReplyId,
   Reply,
+  ReplyToDelete,
 }

+ 7 - 0
types/src/working-group/index.ts

@@ -169,6 +169,12 @@ export class Opening
   })
   implements IOpening {}
 
+// Reward payment type enum.
+export class RewardPaymentType extends JoyEnum({
+  MissedReward: Null,
+  RegularReward: Null,
+}) {}
+
 export const workingGroupTypes: RegistryTypes = {
   ApplicationId,
   Application,
@@ -186,6 +192,7 @@ export const workingGroupTypes: RegistryTypes = {
   OpeningType,
   ApplyOnOpeningParameters,
   Penalty,
+  RewardPaymentType,
 }
 
 export default workingGroupTypes

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů