diff --git a/.changeset/entries/fbe3c507a984b269c88004a4bcde899c907faee6a68ef22cba6fe77b28709132.yaml b/.changeset/entries/fbe3c507a984b269c88004a4bcde899c907faee6a68ef22cba6fe77b28709132.yaml new file mode 100644 index 0000000000..466d758b68 --- /dev/null +++ b/.changeset/entries/fbe3c507a984b269c88004a4bcde899c907faee6a68ef22cba6fe77b28709132.yaml @@ -0,0 +1,6 @@ +type: feat +module: x/posts +pull_request: 942 +description: Allow to specify a post tags for content categorization +backward_compatible: false +date: 2022-06-27T13:23:49.582415174Z diff --git a/client/docs/config.json b/client/docs/config.json index 75680b249d..bbd19672e5 100644 --- a/client/docs/config.json +++ b/client/docs/config.json @@ -21,7 +21,7 @@ "url": "./tmp-swagger-gen/desmos/subspaces/v2/query.swagger.json" }, { - "url": "./tmp-swagger-gen/desmos/posts/v1/query.swagger.json", + "url": "./tmp-swagger-gen/desmos/posts/v2/query.swagger.json", "operationIds": { "rename": { "Params": "PostsParams" diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 532344a031..58a26f280b 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -5267,7 +5267,8 @@ paths: title: >- Tag reference (user address, hashtag value, etc) - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text mentions: type: array items: @@ -5290,7 +5291,8 @@ paths: title: >- Tag reference (user address, hashtag value, etc) - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Mentions present inside the post text urls: type: array items: @@ -5317,6 +5319,12 @@ paths: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' author: type: string title: Author of the post @@ -5728,7 +5736,8 @@ paths: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text mentions: type: array items: @@ -5749,7 +5758,8 @@ paths: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Mentions present inside the post text urls: type: array items: @@ -5776,6 +5786,12 @@ paths: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' author: type: string title: Author of the post @@ -6974,7 +6990,8 @@ paths: title: >- Tag reference (user address, hashtag value, etc) - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text mentions: type: array items: @@ -6997,7 +7014,8 @@ paths: title: >- Tag reference (user address, hashtag value, etc) - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Mentions present inside the post text urls: type: array items: @@ -7024,6 +7042,12 @@ paths: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' author: type: string title: Author of the post @@ -15129,7 +15153,7 @@ definitions: type: string title: Permissions that will be granted to all the users part of this group title: UserGroup represents a group of users - desmos.posts.v1.Attachment: + desmos.posts.v2.Attachment: type: object properties: subspace_id: @@ -15317,7 +15341,7 @@ definitions: } title: Content of the attachment title: Attachment contains the data of a single post attachment - desmos.posts.v1.Entities: + desmos.posts.v2.Entities: type: object properties: hashtags: @@ -15336,7 +15360,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text mentions: type: array items: @@ -15353,7 +15378,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Mentions present inside the post text urls: type: array items: @@ -15374,8 +15400,9 @@ definitions: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL + title: Links present inside the post text title: Contains the details of entities parsed out of the post text - desmos.posts.v1.Params: + desmos.posts.v2.Params: type: object properties: max_text_length: @@ -15383,7 +15410,7 @@ definitions: format: int64 title: Maximum length of the post text title: Params contains the parameters for the posts module - desmos.posts.v1.Post: + desmos.posts.v2.Post: type: object properties: subspace_id: @@ -15426,7 +15453,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text mentions: type: array items: @@ -15445,7 +15473,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Mentions present inside the post text urls: type: array items: @@ -15468,6 +15497,12 @@ definitions: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' author: type: string title: Author of the post @@ -15533,7 +15568,7 @@ definitions: format: date-time title: (optional) Last edited time of the post title: Post contains all the information about a single post - desmos.posts.v1.PostReference: + desmos.posts.v2.PostReference: type: object properties: type: @@ -15563,7 +15598,7 @@ definitions: with the type set to TYPE_QUOTE title: PostReference contains the details of a post reference - desmos.posts.v1.PostReferenceType: + desmos.posts.v2.PostReferenceType: type: string enum: - POST_REFERENCE_TYPE_UNSPECIFIED @@ -15577,7 +15612,7 @@ definitions: - POST_REFERENCE_TYPE_QUOTE: This reference represents a quote of the specified post - POST_REFERENCE_TYPE_REPOST: This reference represents a repost of the specified post title: PostReferenceType represents the different types of references - desmos.posts.v1.QueryParamsResponse: + desmos.posts.v2.QueryParamsResponse: type: object properties: params: @@ -15589,7 +15624,7 @@ definitions: title: Maximum length of the post text title: Params contains the parameters for the posts module title: QueryParamsResponse is the response type for the Query/Params RPC method - desmos.posts.v1.QueryPollAnswersResponse: + desmos.posts.v2.QueryPollAnswersResponse: type: object properties: answers: @@ -15657,7 +15692,7 @@ definitions: RPC method - desmos.posts.v1.QueryPostAttachmentsResponse: + desmos.posts.v2.QueryPostAttachmentsResponse: type: object properties: attachments: @@ -15888,7 +15923,7 @@ definitions: title: |- QueryPostAttachmentsResponse is the response type for the Query/PostAttachments RPC method - desmos.posts.v1.QueryPostResponse: + desmos.posts.v2.QueryPostResponse: type: object properties: post: @@ -15936,7 +15971,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text mentions: type: array items: @@ -15957,7 +15993,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Mentions present inside the post text urls: type: array items: @@ -15982,6 +16019,12 @@ definitions: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' author: type: string title: Author of the post @@ -16048,7 +16091,7 @@ definitions: title: (optional) Last edited time of the post title: Post contains all the information about a single post title: QueryPostResponse is the response type for the Query/Post RPC method - desmos.posts.v1.QuerySectionPostsResponse: + desmos.posts.v2.QuerySectionPostsResponse: type: object properties: posts: @@ -16098,7 +16141,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text mentions: type: array items: @@ -16119,7 +16163,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Mentions present inside the post text urls: type: array items: @@ -16146,6 +16191,12 @@ definitions: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' author: type: string title: Author of the post @@ -16243,7 +16294,7 @@ definitions: RPC method - desmos.posts.v1.QuerySubspacePostsResponse: + desmos.posts.v2.QuerySubspacePostsResponse: type: object properties: posts: @@ -16293,7 +16344,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text mentions: type: array items: @@ -16314,7 +16366,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag + title: TextTag represents a tag within the post text + title: Mentions present inside the post text urls: type: array items: @@ -16341,6 +16394,12 @@ definitions: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' author: type: string title: Author of the post @@ -16438,7 +16497,7 @@ definitions: Query/SubspacePosts RPC method - desmos.posts.v1.ReplySetting: + desmos.posts.v2.ReplySetting: type: string enum: - REPLY_SETTING_UNSPECIFIED @@ -16454,7 +16513,7 @@ definitions: - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply title: ReplySetting contains the possible reply settings that a post can have - desmos.posts.v1.Tag: + desmos.posts.v2.TextTag: type: object properties: start: @@ -16468,8 +16527,8 @@ definitions: tag: type: string title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag - desmos.posts.v1.Url: + title: TextTag represents a tag within the post text + desmos.posts.v2.Url: type: object properties: start: @@ -16487,7 +16546,7 @@ definitions: type: string title: (optional) Display value of the URL title: Url contains the details of a generic URL - desmos.posts.v1.UserAnswer: + desmos.posts.v2.UserAnswer: type: object properties: subspace_id: diff --git a/proto/desmos/posts/v1/models.proto b/proto/desmos/posts/v1/models.proto index b4d0a3f6c5..d7e395ad38 100644 --- a/proto/desmos/posts/v1/models.proto +++ b/proto/desmos/posts/v1/models.proto @@ -6,7 +6,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/posts/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/posts/legacy/v2"; // Post contains all the information about a single post message Post { diff --git a/proto/desmos/posts/v1/client/cli.proto b/proto/desmos/posts/v2/client/cli.proto similarity index 72% rename from proto/desmos/posts/v1/client/cli.proto rename to proto/desmos/posts/v2/client/cli.proto index 5c4e583fee..2d45dd1fbc 100644 --- a/proto/desmos/posts/v1/client/cli.proto +++ b/proto/desmos/posts/v2/client/cli.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package desmos.posts.v1.client; +package desmos.posts.v2.client; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/posts/v1/models.proto"; +import "desmos/posts/v2/models.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/posts/client/utils"; @@ -22,17 +22,20 @@ message CreatePostJSON { // (optional) Entities connected to this post Entities entities = 3; + // Tags related to this post + repeated string tags = 4; + // Attachments of the post - repeated google.protobuf.Any attachments = 4; + repeated google.protobuf.Any attachments = 5; // (optional) Id of the original post of the conversation - uint64 conversation_id = 5 [ (gogoproto.customname) = "ConversationID" ]; + uint64 conversation_id = 6 [ (gogoproto.customname) = "ConversationID" ]; // Reply settings of this post - ReplySetting reply_settings = 6; + ReplySetting reply_settings = 7; // A list this posts references (either as a reply, repost or quote) - repeated PostReference referenced_posts = 7 [ (gogoproto.nullable) = false ]; + repeated PostReference referenced_posts = 8 [ (gogoproto.nullable) = false ]; } // EditPostJSON contains the data that can be specified when editing a Post @@ -43,4 +46,7 @@ message EditPostJSON { // New entities connected to this post Entities entities = 2; + + // New tags associated to this post + repeated string tags = 3; } \ No newline at end of file diff --git a/proto/desmos/posts/v1/genesis.proto b/proto/desmos/posts/v2/genesis.proto similarity index 96% rename from proto/desmos/posts/v1/genesis.proto rename to proto/desmos/posts/v2/genesis.proto index d122d2237c..4056ceaec9 100644 --- a/proto/desmos/posts/v1/genesis.proto +++ b/proto/desmos/posts/v2/genesis.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.posts.v1; +package desmos.posts.v2; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -import "desmos/posts/v1/models.proto"; +import "desmos/posts/v2/models.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/posts/types"; diff --git a/proto/desmos/posts/v2/models.proto b/proto/desmos/posts/v2/models.proto new file mode 100644 index 0000000000..38467ea581 --- /dev/null +++ b/proto/desmos/posts/v2/models.proto @@ -0,0 +1,282 @@ +syntax = "proto3"; +package desmos.posts.v2; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/posts/types"; + +// Post contains all the information about a single post +message Post { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Id of the subspace inside which the post has been created + uint64 subspace_id = 1 [ (gogoproto.customname) = "SubspaceID" ]; + + // Id of the section inside which the post has been created + uint32 section_id = 2 [ (gogoproto.customname) = "SectionID" ]; + + // Unique id of the post + uint64 id = 3 [ (gogoproto.customname) = "ID" ]; + + // (optional) External id for this post + string external_id = 4 [ (gogoproto.customname) = "ExternalID" ]; + + // (optional) Text of the post + string text = 5; + + // (optional) Entities connected to this post + Entities entities = 6; + + // Tags related to this post, useful for categorization + repeated string tags = 7; + + // Author of the post + string author = 8; + + // (optional) Id of the original post of the conversation + uint64 conversation_id = 9 [ (gogoproto.customname) = "ConversationID" ]; + + // A list this posts references (either as a reply, repost or quote) + repeated PostReference referenced_posts = 10 [ (gogoproto.nullable) = false ]; + + // Reply settings of this post + ReplySetting reply_settings = 11; + + // Creation date of the post + google.protobuf.Timestamp creation_date = 12 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // (optional) Last edited time of the post + google.protobuf.Timestamp last_edited_date = 13 + [ (gogoproto.stdtime) = true ]; +} + +// PostReference contains the details of a post reference +message PostReference { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Type of reference + PostReferenceType type = 1; + + // Id of the referenced post + uint64 post_id = 2 [ (gogoproto.customname) = "PostID" ]; + + // Position of the reference inside the post's text. This should be used only + // with the type set to TYPE_QUOTE + uint64 position = 3; +} + +// PostReferenceType represents the different types of references +enum PostReferenceType { + option (gogoproto.goproto_enum_prefix) = false; + + // No reference specified + POST_REFERENCE_TYPE_UNSPECIFIED = 0; + + // This reference represents a reply to the specified post + POST_REFERENCE_TYPE_REPLY = 1; + + // This reference represents a quote of the specified post + POST_REFERENCE_TYPE_QUOTE = 2; + + // This reference represents a repost of the specified post + POST_REFERENCE_TYPE_REPOST = 3; +} + +// Contains the details of entities parsed out of the post text +message Entities { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Hashtags represent inside the post text + repeated TextTag hashtags = 1 [ (gogoproto.nullable) = false ]; + + // Mentions present inside the post text + repeated TextTag mentions = 2 [ (gogoproto.nullable) = false ]; + + // Links present inside the post text + repeated Url urls = 3 [ (gogoproto.nullable) = false ]; +} + +// ReplySetting contains the possible reply settings that a post can have +enum ReplySetting { + option (gogoproto.goproto_enum_prefix) = false; + + // No reply setting specified + REPLY_SETTING_UNSPECIFIED = 0; + + // Everyone will be able to reply to this post + REPLY_SETTING_EVERYONE = 1; + + // Only followers of the author will be able to reply to this post + REPLY_SETTING_FOLLOWERS = 2; + + // Only the author mutual followers will be able to reply to this post + REPLY_SETTING_MUTUAL = 3; + + // Only people mentioned inside this post will be able to reply + REPLY_SETTING_MENTIONS = 4; +} + +// TextTag represents a tag within the post text +message TextTag { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Index of the character inside the text at which the tag starts + uint64 start = 1; + + // Index of the character inside the text at which the tag ends + uint64 end = 2; + + // Tag reference (user address, hashtag value, etc) + string tag = 3; +} + +// Url contains the details of a generic URL +message Url { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Index of the character inside the text at which the URL starts + uint64 start = 1; + + // Index of the character inside the text at which the URL ends + uint64 end = 2; + + // Value of the URL where the user should be redirected to + string url = 3; + + // (optional) Display value of the URL + string display_url = 4; +} + +// Attachment contains the data of a single post attachment +message Attachment { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Id of the subspace inside which the post to which this attachment should be + // connected is + uint64 subspace_id = 1 [ (gogoproto.customname) = "SubspaceID" ]; + + // Id of the subspace section inside which the post to which this attachment + // should be connected is + uint32 section_id = 2 [ (gogoproto.customname) = "SectionID" ]; + + // Id of the post to which this attachment should be connected + uint64 post_id = 3 [ (gogoproto.customname) = "PostID" ]; + + // If of this attachment + uint32 id = 4 [ (gogoproto.customname) = "ID" ]; + + // Content of the attachment + google.protobuf.Any content = 5 + [ (cosmos_proto.accepts_interface) = "AttachmentContent" ]; +} + +// Media represents a media attachment +message Media { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "AttachmentContent"; + + string uri = 2; + string mime_type = 3; +} + +// Poll represents a poll attachment +message Poll { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "AttachmentContent"; + + // Question of the poll + string question = 1; + + // Answers the users can choose from + repeated ProvidedAnswer provided_answers = 2 [ (gogoproto.nullable) = false ]; + + // Date at which the poll will close + google.protobuf.Timestamp end_date = 3 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // Whether the poll allows multiple choices from the same user or not + bool allows_multiple_answers = 4; + + // Whether the poll allows to edit an answer or not + bool allows_answer_edits = 5; + + // Final poll results + PollTallyResults final_tally_results = 6; + + // Provided answer contains the details of a possible poll answer + message ProvidedAnswer { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // (optional) Text of the answer + string text = 1; + + // Attachments of the answer + repeated Attachment attachments = 2 [ (gogoproto.nullable) = false ]; + } +} + +// UserAnswer represents a user answer to a poll +message UserAnswer { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Subspace id inside which the post related to this attachment is located + uint64 subspace_id = 1 [ (gogoproto.customname) = "SubspaceID" ]; + + // Section id inside which the post related to this attachment is located + uint32 section_id = 2 [ (gogoproto.customname) = "SectionID" ]; + + // Id of the post associated to this attachment + uint64 post_id = 3 [ (gogoproto.customname) = "PostID" ]; + + // Id of the poll to which this answer is associated + uint32 poll_id = 4 [ (gogoproto.customname) = "PollID" ]; + + // Indexes of the answers inside the ProvidedAnswers array + repeated uint32 answers_indexes = 5; + + // Address of the user answering the poll + string user = 6; +} + +// PollTallyResults contains the tally results for a poll +message PollTallyResults { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + repeated AnswerResult results = 1 [ (gogoproto.nullable) = false ]; + + // AnswerResult contains the result of a single poll provided answer + message AnswerResult { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Index of the answer inside the poll's ProvidedAnswers slice + uint32 answer_index = 1; + + // Number of votes the answer has received + uint64 votes = 2; + } +} + +// Params contains the parameters for the posts module +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Maximum length of the post text + uint32 max_text_length = 1; +} \ No newline at end of file diff --git a/proto/desmos/posts/v1/msgs.proto b/proto/desmos/posts/v2/msgs.proto similarity index 92% rename from proto/desmos/posts/v1/msgs.proto rename to proto/desmos/posts/v2/msgs.proto index 1841bcdb91..f6f8993027 100644 --- a/proto/desmos/posts/v1/msgs.proto +++ b/proto/desmos/posts/v2/msgs.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package desmos.posts.v1; +package desmos.posts.v2; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/posts/v1/models.proto"; +import "desmos/posts/v2/models.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/posts/types"; @@ -50,21 +50,24 @@ message MsgCreatePost { // (optional) Entities connected to this post Entities entities = 5; + // Tags connected to this post + repeated string tags = 6; + // Attachments of the post - repeated google.protobuf.Any attachments = 6 + repeated google.protobuf.Any attachments = 7 [ (cosmos_proto.accepts_interface) = "AttachmentContent" ]; // Author of the post - string author = 7; + string author = 8; // (optional) Id of the original post of the conversation - uint64 conversation_id = 8 [ (gogoproto.customname) = "ConversationID" ]; + uint64 conversation_id = 9 [ (gogoproto.customname) = "ConversationID" ]; // Reply settings of this post - ReplySetting reply_settings = 9; + ReplySetting reply_settings = 10; // A list this posts references (either as a reply, repost or quote) - repeated PostReference referenced_posts = 10 [ (gogoproto.nullable) = false ]; + repeated PostReference referenced_posts = 11 [ (gogoproto.nullable) = false ]; } // MsgCreatePostResponse defines the Msg/CreatePost response type. @@ -93,8 +96,12 @@ message MsgEditPost { // post's entities Entities entities = 4; + // New tags connected to this post. These will always replace the current + // post's tags + repeated string tags = 5; + // Editor of the post - string editor = 5; + string editor = 6; } // MsgCreatePostResponse defines the Msg/EditPost response type. diff --git a/proto/desmos/posts/v1/query.proto b/proto/desmos/posts/v2/query.proto similarity index 98% rename from proto/desmos/posts/v1/query.proto rename to proto/desmos/posts/v2/query.proto index e6032e6040..be31340d5e 100644 --- a/proto/desmos/posts/v1/query.proto +++ b/proto/desmos/posts/v2/query.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package desmos.posts.v1; +package desmos.posts.v2; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "desmos/posts/v1/models.proto"; +import "desmos/posts/v2/models.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/posts/types"; diff --git a/x/posts/client/cli/cli_test.go b/x/posts/client/cli/cli_test.go index b991cd9b7f..1df6420357 100644 --- a/x/posts/client/cli/cli_test.go +++ b/x/posts/client/cli/cli_test.go @@ -87,6 +87,7 @@ func (s *IntegrationTestSuite) SetupSuite() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -101,6 +102,7 @@ func (s *IntegrationTestSuite) SetupSuite() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -185,6 +187,7 @@ func (s *IntegrationTestSuite) TestCmdQueryPost() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + []string{}, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -243,6 +246,7 @@ func (s *IntegrationTestSuite) TestCmdQueryPosts() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + []string{}, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -270,6 +274,7 @@ func (s *IntegrationTestSuite) TestCmdQueryPosts() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + []string{}, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), diff --git a/x/posts/client/cli/tx.go b/x/posts/client/cli/tx.go index 669eeffb71..fd3bd40a46 100644 --- a/x/posts/client/cli/tx.go +++ b/x/posts/client/cli/tx.go @@ -84,6 +84,7 @@ func GetCmdCreatePost() *cobra.Command { data.ConversationID, data.ReplySettings, data.Entities, + data.Tags, attachments, data.ReferencedPosts, author, @@ -137,6 +138,7 @@ func GetCmdEditPost() *cobra.Command { postID, data.Text, data.Entities, + data.Tags, editor, ) if err = msg.ValidateBasic(); err != nil { diff --git a/x/posts/client/utils/cli.pb.go b/x/posts/client/utils/cli.pb.go index fb3d8a7875..6d8242a968 100644 --- a/x/posts/client/utils/cli.pb.go +++ b/x/posts/client/utils/cli.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/posts/v1/client/cli.proto +// source: desmos/posts/v2/client/cli.proto package utils @@ -36,21 +36,23 @@ type CreatePostJSON struct { Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // (optional) Entities connected to this post Entities *types.Entities `protobuf:"bytes,3,opt,name=entities,proto3" json:"entities,omitempty"` + // Tags related to this post + Tags []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"` // Attachments of the post - Attachments []*types1.Any `protobuf:"bytes,4,rep,name=attachments,proto3" json:"attachments,omitempty"` + Attachments []*types1.Any `protobuf:"bytes,5,rep,name=attachments,proto3" json:"attachments,omitempty"` // (optional) Id of the original post of the conversation - ConversationID uint64 `protobuf:"varint,5,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` + ConversationID uint64 `protobuf:"varint,6,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` // Reply settings of this post - ReplySettings types.ReplySetting `protobuf:"varint,6,opt,name=reply_settings,json=replySettings,proto3,enum=desmos.posts.v1.ReplySetting" json:"reply_settings,omitempty"` + ReplySettings types.ReplySetting `protobuf:"varint,7,opt,name=reply_settings,json=replySettings,proto3,enum=desmos.posts.v2.ReplySetting" json:"reply_settings,omitempty"` // A list this posts references (either as a reply, repost or quote) - ReferencedPosts []types.PostReference `protobuf:"bytes,7,rep,name=referenced_posts,json=referencedPosts,proto3" json:"referenced_posts"` + ReferencedPosts []types.PostReference `protobuf:"bytes,8,rep,name=referenced_posts,json=referencedPosts,proto3" json:"referenced_posts"` } func (m *CreatePostJSON) Reset() { *m = CreatePostJSON{} } func (m *CreatePostJSON) String() string { return proto.CompactTextString(m) } func (*CreatePostJSON) ProtoMessage() {} func (*CreatePostJSON) Descriptor() ([]byte, []int) { - return fileDescriptor_905ce8d49fe91e44, []int{0} + return fileDescriptor_d5899b795c71461f, []int{0} } func (m *CreatePostJSON) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -100,6 +102,13 @@ func (m *CreatePostJSON) GetEntities() *types.Entities { return nil } +func (m *CreatePostJSON) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + func (m *CreatePostJSON) GetAttachments() []*types1.Any { if m != nil { return m.Attachments @@ -135,13 +144,15 @@ type EditPostJSON struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // New entities connected to this post Entities *types.Entities `protobuf:"bytes,2,opt,name=entities,proto3" json:"entities,omitempty"` + // New tags associated to this post + Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` } func (m *EditPostJSON) Reset() { *m = EditPostJSON{} } func (m *EditPostJSON) String() string { return proto.CompactTextString(m) } func (*EditPostJSON) ProtoMessage() {} func (*EditPostJSON) Descriptor() ([]byte, []int) { - return fileDescriptor_905ce8d49fe91e44, []int{1} + return fileDescriptor_d5899b795c71461f, []int{1} } func (m *EditPostJSON) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -184,44 +195,52 @@ func (m *EditPostJSON) GetEntities() *types.Entities { return nil } +func (m *EditPostJSON) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + func init() { - proto.RegisterType((*CreatePostJSON)(nil), "desmos.posts.v1.client.CreatePostJSON") - proto.RegisterType((*EditPostJSON)(nil), "desmos.posts.v1.client.EditPostJSON") -} - -func init() { proto.RegisterFile("desmos/posts/v1/client/cli.proto", fileDescriptor_905ce8d49fe91e44) } - -var fileDescriptor_905ce8d49fe91e44 = []byte{ - // 459 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xe3, 0x26, 0x14, 0xd8, 0x80, 0x8b, 0x56, 0x15, 0x72, 0x2b, 0x70, 0xac, 0x9e, 0x7c, - 0x61, 0x57, 0x0d, 0x94, 0x0b, 0x27, 0xd2, 0xe4, 0x10, 0x0e, 0x04, 0x6d, 0x4f, 0x70, 0x89, 0x1c, - 0x7b, 0xea, 0xae, 0x64, 0xef, 0x46, 0xde, 0x49, 0x94, 0xbc, 0x05, 0x47, 0x1e, 0xa9, 0xc7, 0x1e, - 0x39, 0x45, 0xc8, 0x79, 0x11, 0xe4, 0x7f, 0x25, 0x4a, 0x85, 0xd4, 0x93, 0x67, 0xfc, 0xfd, 0x66, - 0x76, 0xf6, 0xdb, 0x21, 0x5e, 0x04, 0x26, 0xd5, 0x86, 0xcf, 0xb5, 0x41, 0xc3, 0x97, 0xe7, 0x3c, - 0x4c, 0x24, 0x28, 0x2c, 0x3e, 0x6c, 0x9e, 0x69, 0xd4, 0xf4, 0x75, 0x45, 0xb0, 0x92, 0x60, 0xcb, - 0x73, 0x56, 0x11, 0xa7, 0xc7, 0xb1, 0x8e, 0x75, 0x89, 0xf0, 0x22, 0xaa, 0xe8, 0xd3, 0x93, 0x58, - 0xeb, 0x38, 0x01, 0x5e, 0x66, 0xb3, 0xc5, 0x35, 0x0f, 0xd4, 0xba, 0x96, 0x7a, 0xfb, 0x12, 0xca, - 0x14, 0x0c, 0x06, 0xe9, 0xbc, 0xa9, 0x0d, 0x75, 0x71, 0xd2, 0xb4, 0x6a, 0x5a, 0x25, 0xb5, 0xf4, - 0x66, 0x7f, 0xcc, 0x54, 0x47, 0x90, 0xd4, 0xea, 0xd9, 0xaf, 0x36, 0xb1, 0x2f, 0x33, 0x08, 0x10, - 0xbe, 0x69, 0x83, 0x5f, 0xae, 0x26, 0x5f, 0x29, 0x27, 0x5d, 0x58, 0x21, 0x64, 0x2a, 0x48, 0xa6, - 0x32, 0x72, 0x2c, 0xcf, 0xf2, 0x9f, 0x0f, 0xec, 0x7c, 0xd3, 0x23, 0xa3, 0xfa, 0xf7, 0x78, 0x28, - 0x48, 0x83, 0x8c, 0x23, 0x4a, 0x49, 0x07, 0x61, 0x85, 0xce, 0x41, 0x41, 0x8a, 0x32, 0xa6, 0x17, - 0xe4, 0x19, 0x28, 0x94, 0x28, 0xc1, 0x38, 0x6d, 0xcf, 0xf2, 0xbb, 0xfd, 0x13, 0xb6, 0xef, 0x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bc, 0x6a, 0xf4, 0x2e, 0x09, 0x66, 0xa6, 0x8e, 0xf9, 0xf2, 0x03, 0x5f, - 0xd5, 0x9b, 0x54, 0x6f, 0xfb, 0x02, 0x65, 0x62, 0x66, 0x87, 0xe5, 0xd3, 0xbc, 0xff, 0x1b, 0x00, - 0x00, 0xff, 0xff, 0xb9, 0x94, 0x1a, 0x7a, 0x14, 0x03, 0x00, 0x00, + proto.RegisterType((*CreatePostJSON)(nil), "desmos.posts.v2.client.CreatePostJSON") + proto.RegisterType((*EditPostJSON)(nil), "desmos.posts.v2.client.EditPostJSON") +} + +func init() { proto.RegisterFile("desmos/posts/v2/client/cli.proto", fileDescriptor_d5899b795c71461f) } + +var fileDescriptor_d5899b795c71461f = []byte{ + // 474 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xe3, 0x3a, 0x94, 0xb2, 0x01, 0x17, 0xad, 0x2a, 0xe4, 0x56, 0xe0, 0x58, 0x3d, 0xf9, + 0x82, 0x57, 0x32, 0x94, 0x0b, 0x27, 0xd2, 0xe4, 0x10, 0x0e, 0x04, 0xb9, 0x37, 0x2e, 0xd1, 0xc6, + 0x9e, 0xba, 0x2b, 0xd9, 0xbb, 0x91, 0x77, 0x12, 0x25, 0x6f, 0xc1, 0x83, 0xf0, 0x20, 0x3d, 0xf6, + 0xc8, 0x29, 0x42, 0xce, 0x8b, 0x20, 0xff, 0x6b, 0xa3, 0x44, 0x1c, 0x38, 0x79, 0xc6, 0xdf, 0x6f, + 0x3e, 0xef, 0x7e, 0xeb, 0x25, 0x6e, 0x0c, 0x3a, 0x53, 0x9a, 0xcd, 0x95, 0x46, 0xcd, 0x96, 0x01, + 0x8b, 0x52, 0x01, 0x12, 0xcb, 0x87, 0x3f, 0xcf, 0x15, 0x2a, 0xfa, 0xa6, 0x26, 0xfc, 0x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} func (m *CreatePostJSON) Marshal() (dAtA []byte, err error) { @@ -255,18 +274,18 @@ func (m *CreatePostJSON) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintCli(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 } } if m.ReplySettings != 0 { i = encodeVarintCli(dAtA, i, uint64(m.ReplySettings)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x38 } if m.ConversationID != 0 { i = encodeVarintCli(dAtA, i, uint64(m.ConversationID)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x30 } if len(m.Attachments) > 0 { for iNdEx := len(m.Attachments) - 1; iNdEx >= 0; iNdEx-- { @@ -279,6 +298,15 @@ func (m *CreatePostJSON) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintCli(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x2a + } + } + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tags[iNdEx]) + copy(dAtA[i:], m.Tags[iNdEx]) + i = encodeVarintCli(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i-- dAtA[i] = 0x22 } } @@ -331,6 +359,15 @@ func (m *EditPostJSON) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tags[iNdEx]) + copy(dAtA[i:], m.Tags[iNdEx]) + i = encodeVarintCli(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if m.Entities != nil { { size, err := m.Entities.MarshalToSizedBuffer(dAtA[:i]) @@ -382,6 +419,12 @@ func (m *CreatePostJSON) Size() (n int) { l = m.Entities.Size() n += 1 + l + sovCli(uint64(l)) } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovCli(uint64(l)) + } + } if len(m.Attachments) > 0 { for _, e := range m.Attachments { l = e.Size() @@ -417,6 +460,12 @@ func (m *EditPostJSON) Size() (n int) { l = m.Entities.Size() n += 1 + l + sovCli(uint64(l)) } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovCli(uint64(l)) + } + } return n } @@ -556,6 +605,38 @@ func (m *CreatePostJSON) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCli + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCli + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCli + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Attachments", wireType) } @@ -589,7 +670,7 @@ func (m *CreatePostJSON) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ConversationID", wireType) } @@ -608,7 +689,7 @@ func (m *CreatePostJSON) Unmarshal(dAtA []byte) error { break } } - case 6: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReplySettings", wireType) } @@ -627,7 +708,7 @@ func (m *CreatePostJSON) Unmarshal(dAtA []byte) error { break } } - case 7: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ReferencedPosts", wireType) } @@ -779,6 +860,38 @@ func (m *EditPostJSON) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCli + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCli + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCli + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCli(dAtA[iNdEx:]) diff --git a/x/posts/keeper/external_hooks_test.go b/x/posts/keeper/external_hooks_test.go index 88c465a979..6388a28ec1 100644 --- a/x/posts/keeper/external_hooks_test.go +++ b/x/posts/keeper/external_hooks_test.go @@ -106,6 +106,7 @@ func (suite *KeeperTestsuite) TestKeeper_AfterSubspaceDeleted() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -120,6 +121,7 @@ func (suite *KeeperTestsuite) TestKeeper_AfterSubspaceDeleted() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -180,6 +182,7 @@ func (suite *KeeperTestsuite) TestKeeper_AfterSectionDeleted() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -194,6 +197,7 @@ func (suite *KeeperTestsuite) TestKeeper_AfterSectionDeleted() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/posts/keeper/genesis_test.go b/x/posts/keeper/genesis_test.go index e1f20caad3..8c995c36c1 100644 --- a/x/posts/keeper/genesis_test.go +++ b/x/posts/keeper/genesis_test.go @@ -63,6 +63,7 @@ func (suite *KeeperTestsuite) TestKeeper_ExportGenesis() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -79,6 +80,7 @@ func (suite *KeeperTestsuite) TestKeeper_ExportGenesis() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -97,6 +99,7 @@ func (suite *KeeperTestsuite) TestKeeper_ExportGenesis() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -111,6 +114,7 @@ func (suite *KeeperTestsuite) TestKeeper_ExportGenesis() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -286,6 +290,7 @@ func (suite *KeeperTestsuite) TestKeeper_ImportGenesis() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -305,6 +310,7 @@ func (suite *KeeperTestsuite) TestKeeper_ImportGenesis() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -358,6 +364,7 @@ func (suite *KeeperTestsuite) TestKeeper_ImportGenesis() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -403,6 +410,7 @@ func (suite *KeeperTestsuite) TestKeeper_ImportGenesis() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/posts/keeper/grpc_query_test.go b/x/posts/keeper/grpc_query_test.go index 9e76b9fbe0..d2f4d4f629 100644 --- a/x/posts/keeper/grpc_query_test.go +++ b/x/posts/keeper/grpc_query_test.go @@ -35,6 +35,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SubspacePosts() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -49,6 +50,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SubspacePosts() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 13, 00, 00, 000, time.UTC), nil, @@ -67,6 +69,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SubspacePosts() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -81,6 +84,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SubspacePosts() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 13, 00, 00, 000, time.UTC), nil, @@ -100,6 +104,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SubspacePosts() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -114,6 +119,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SubspacePosts() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 13, 00, 00, 000, time.UTC), nil, @@ -134,6 +140,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SubspacePosts() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -187,6 +194,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SectionPosts() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -201,6 +209,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SectionPosts() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 13, 00, 00, 000, time.UTC), nil, @@ -219,6 +228,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SectionPosts() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -233,6 +243,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SectionPosts() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 13, 00, 00, 000, time.UTC), nil, @@ -252,6 +263,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SectionPosts() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -266,6 +278,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SectionPosts() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 13, 00, 00, 000, time.UTC), nil, @@ -286,6 +299,7 @@ func (suite *KeeperTestsuite) TestQueryServer_SectionPosts() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -349,6 +363,7 @@ func (suite *KeeperTestsuite) TestQueryServer_Post() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -366,6 +381,7 @@ func (suite *KeeperTestsuite) TestQueryServer_Post() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/posts/keeper/invariants_test.go b/x/posts/keeper/invariants_test.go index 1bed11324d..cf91595e51 100644 --- a/x/posts/keeper/invariants_test.go +++ b/x/posts/keeper/invariants_test.go @@ -83,6 +83,7 @@ func (suite *KeeperTestsuite) TestValidPostsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -113,6 +114,7 @@ func (suite *KeeperTestsuite) TestValidPostsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -144,6 +146,7 @@ func (suite *KeeperTestsuite) TestValidPostsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -175,6 +178,7 @@ func (suite *KeeperTestsuite) TestValidPostsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -207,6 +211,7 @@ func (suite *KeeperTestsuite) TestValidPostsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -239,6 +244,7 @@ func (suite *KeeperTestsuite) TestValidPostsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -320,6 +326,7 @@ func (suite *KeeperTestsuite) TestValidAttachmentsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -354,6 +361,7 @@ func (suite *KeeperTestsuite) TestValidAttachmentsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -389,6 +397,7 @@ func (suite *KeeperTestsuite) TestValidAttachmentsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -424,6 +433,7 @@ func (suite *KeeperTestsuite) TestValidAttachmentsInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -505,6 +515,7 @@ func (suite *KeeperTestsuite) TestValidUserAnswersInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -537,6 +548,7 @@ func (suite *KeeperTestsuite) TestValidUserAnswersInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -581,6 +593,7 @@ func (suite *KeeperTestsuite) TestValidUserAnswersInvariant() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/posts/keeper/migrations.go b/x/posts/keeper/migrations.go index a9ef4ee191..941120afc0 100644 --- a/x/posts/keeper/migrations.go +++ b/x/posts/keeper/migrations.go @@ -5,6 +5,8 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + v3 "github.com/desmos-labs/desmos/v4/x/posts/legacy/v3" + v2 "github.com/desmos-labs/desmos/v4/x/posts/legacy/v2" "github.com/desmos-labs/desmos/v4/x/posts/types" ) @@ -27,3 +29,8 @@ func NewMigrator(keeper Keeper, sk types.SubspacesKeeper) Migrator { func (m Migrator) Migrate1to2(ctx sdk.Context) error { return v2.MigrateStore(ctx, m.k.storeKey, m.k.paramsSubspace, m.sk) } + +// Migrate2to3 migrates from version 2 to 3. +func (m Migrator) Migrate2to3(ctx sdk.Context) error { + return v3.MigrateStore(ctx, m.k.storeKey, m.k.cdc) +} diff --git a/x/posts/keeper/msg_server.go b/x/posts/keeper/msg_server.go index 7ce7ddd00f..d6461dc437 100644 --- a/x/posts/keeper/msg_server.go +++ b/x/posts/keeper/msg_server.go @@ -65,6 +65,7 @@ func (k msgServer) CreatePost(goCtx context.Context, msg *types.MsgCreatePost) ( msg.Author, msg.ConversationID, msg.Entities, + msg.Tags, msg.ReferencedPosts, msg.ReplySettings, ctx.BlockTime(), @@ -145,7 +146,7 @@ func (k msgServer) EditPost(goCtx context.Context, msg *types.MsgEditPost) (*typ // Update the post and validate it updateTime := ctx.BlockTime() - update := types.NewPostUpdate(msg.Text, msg.Entities, updateTime) + update := types.NewPostUpdate(msg.Text, msg.Entities, msg.Tags, updateTime) updatedPost := post.Update(update) err := k.ValidatePost(ctx, updatedPost) if err != nil { diff --git a/x/posts/keeper/msg_server_test.go b/x/posts/keeper/msg_server_test.go index e9791264ca..1ca2abf63e 100644 --- a/x/posts/keeper/msg_server_test.go +++ b/x/posts/keeper/msg_server_test.go @@ -35,6 +35,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { nil, nil, nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -55,6 +56,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { nil, nil, nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -71,6 +73,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { nil, nil, nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), store: func(ctx sdk.Context) { @@ -115,6 +118,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { nil, nil, nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -154,6 +158,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { nil, nil, nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -191,6 +196,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { 0, types.REPLY_SETTING_EVERYONE, nil, + nil, []types.AttachmentContent{ types.NewMedia("", ""), }, @@ -234,6 +240,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { nil, nil, nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -279,6 +286,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { nil, nil, nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -321,6 +329,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { 0, types.REPLY_SETTING_EVERYONE, nil, + nil, []types.AttachmentContent{ types.NewMedia("", ""), }, @@ -367,6 +376,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { 0, types.REPLY_SETTING_EVERYONE, nil, + []string{"generic"}, []types.AttachmentContent{ types.NewMedia("ftp://user:password@host:post/media.png", "media/png"), }, @@ -407,6 +417,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreatePost() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + []string{"generic"}, nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -473,6 +484,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 1, "This is my new text", nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -495,6 +507,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 1, "This is my new text", nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -522,6 +535,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -532,6 +546,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 1, "This is my new text", nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -559,6 +574,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -569,6 +585,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 1, "This is my new text", nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -606,6 +623,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -619,6 +637,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 1, "This is my new text", nil, + nil, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: true, @@ -658,6 +677,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -668,6 +688,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { 1, "This is my new text", nil, + []string{"generic"}, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ), shouldErr: false, @@ -703,6 +724,7 @@ func (suite *KeeperTestsuite) TestMsgServer_EditPost() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + []string{"generic"}, nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -801,6 +823,7 @@ func (suite *KeeperTestsuite) TestMsgServer_DeletePost() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -839,6 +862,7 @@ func (suite *KeeperTestsuite) TestMsgServer_DeletePost() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -877,6 +901,7 @@ func (suite *KeeperTestsuite) TestMsgServer_DeletePost() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -931,6 +956,7 @@ func (suite *KeeperTestsuite) TestMsgServer_DeletePost() { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1050,6 +1076,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AddPostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1086,6 +1113,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AddPostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1124,6 +1152,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AddPostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1172,6 +1201,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AddPostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1324,6 +1354,7 @@ func (suite *KeeperTestsuite) TestMsgServer_RemovePostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1367,6 +1398,7 @@ func (suite *KeeperTestsuite) TestMsgServer_RemovePostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1410,6 +1442,7 @@ func (suite *KeeperTestsuite) TestMsgServer_RemovePostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1458,6 +1491,7 @@ func (suite *KeeperTestsuite) TestMsgServer_RemovePostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1542,6 +1576,7 @@ func (suite *KeeperTestsuite) TestMsgServer_RemovePostAttachment() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1747,6 +1782,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AnswerPoll() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1794,6 +1830,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AnswerPoll() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1866,6 +1903,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AnswerPoll() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1930,6 +1968,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AnswerPoll() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -1994,6 +2033,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AnswerPoll() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -2092,6 +2132,7 @@ func (suite *KeeperTestsuite) TestMsgServer_AnswerPoll() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/posts/keeper/posts_test.go b/x/posts/keeper/posts_test.go index 535bfa1fab..ac9752faf1 100644 --- a/x/posts/keeper/posts_test.go +++ b/x/posts/keeper/posts_test.go @@ -186,6 +186,7 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePostReference() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -209,7 +210,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePostReference() { 0, nil, nil, - types.REPLY_SETTING_EVERYONE, + + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, )) @@ -268,7 +270,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePostReply() { 0, nil, nil, - types.REPLY_SETTING_FOLLOWERS, + + nil, types.REPLY_SETTING_FOLLOWERS, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, )) @@ -297,7 +300,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePostReply() { 0, nil, nil, - types.REPLY_SETTING_FOLLOWERS, + + nil, types.REPLY_SETTING_FOLLOWERS, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, )) @@ -326,7 +330,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePostReply() { 0, nil, nil, - types.REPLY_SETTING_MENTIONS, + + nil, types.REPLY_SETTING_MENTIONS, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, )) @@ -361,7 +366,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePostReply() { 0, nil, nil, - types.REPLY_SETTING_MENTIONS, + + nil, types.REPLY_SETTING_MENTIONS, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, )) @@ -384,7 +390,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePostReply() { 0, nil, nil, - types.REPLY_SETTING_MENTIONS, + + nil, types.REPLY_SETTING_MENTIONS, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, )) @@ -405,10 +412,11 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePostReply() { "This is a test post", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 0, - types.NewEntities(nil, []types.Tag{ - types.NewTag(0, 44, "cosmos1t457f629cc3ykftepjejgzxv0vmz5dw2gn940g"), + types.NewEntities(nil, []types.TextTag{ + types.NewTextTag(0, 44, "cosmos1t457f629cc3ykftepjejgzxv0vmz5dw2gn940g"), }, nil), nil, + nil, types.REPLY_SETTING_MENTIONS, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -459,20 +467,9 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePost() { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), - }, - []types.Tag{ - types.NewTag(4, 6, "tag"), - }, - []types.Url{ - types.NewURL(7, 9, "URL", "Display URL"), - }, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -492,17 +489,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePost() { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), - }, - []types.Tag{ - types.NewTag(4, 6, "tag"), - }, - []types.Url{ - types.NewURL(7, 9, "URL", "Display URL"), - }, - ), + nil, + nil, nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -523,17 +511,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePost() { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 0, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), - }, - []types.Tag{ - types.NewTag(4, 6, "tag"), - }, - []types.Url{ - types.NewURL(7, 9, "URL", "Display URL"), - }, - ), + nil, + nil, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -558,6 +537,7 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePost() { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -578,7 +558,8 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePost() { 0, nil, nil, - types.REPLY_SETTING_EVERYONE, + + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, )) @@ -592,16 +573,17 @@ func (suite *KeeperTestsuite) TestKeeper_ValidatePost() { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"generic"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_REPLY, 1, 0), }, @@ -649,16 +631,17 @@ func (suite *KeeperTestsuite) TestKeeper_SavePost() { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"generic"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -679,16 +662,17 @@ func (suite *KeeperTestsuite) TestKeeper_SavePost() { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"generic"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -719,16 +703,17 @@ func (suite *KeeperTestsuite) TestKeeper_SavePost() { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"generic"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -746,16 +731,17 @@ func (suite *KeeperTestsuite) TestKeeper_SavePost() { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"generic"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -776,16 +762,17 @@ func (suite *KeeperTestsuite) TestKeeper_SavePost() { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"generic"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -847,20 +834,9 @@ func (suite *KeeperTestsuite) TestKeeper_HasPost() { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), - }, - []types.Tag{ - types.NewTag(4, 6, "tag"), - }, - []types.Url{ - types.NewURL(7, 9, "URL", "Display URL"), - }, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -914,16 +890,17 @@ func (suite *KeeperTestsuite) TestKeeper_GetPost() { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"generic"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -944,16 +921,17 @@ func (suite *KeeperTestsuite) TestKeeper_GetPost() { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"generic"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -1006,20 +984,9 @@ func (suite *KeeperTestsuite) TestKeeper_DeletePost() { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), - }, - []types.Tag{ - types.NewTag(4, 6, "tag"), - }, - []types.Url{ - types.NewURL(7, 9, "URL", "Display URL"), - }, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/posts/legacy/v2/models.go b/x/posts/legacy/v2/models.go new file mode 100644 index 0000000000..e47d4c73ee --- /dev/null +++ b/x/posts/legacy/v2/models.go @@ -0,0 +1,73 @@ +package v2 + +// DONTCOVER + +import "time" + +// NewPost allows to build a new Post instance +func NewPost( + subspaceID uint64, + sectionID uint32, + id uint64, + externalID string, + text string, + author string, + conversationID uint64, + entities *Entities, + referencedPosts []PostReference, + replySetting ReplySetting, + creationDate time.Time, + lastEditedDate *time.Time, +) Post { + return Post{ + SubspaceID: subspaceID, + SectionID: sectionID, + ID: id, + ExternalID: externalID, + Text: text, + Entities: entities, + Author: author, + ConversationID: conversationID, + ReferencedPosts: referencedPosts, + ReplySettings: replySetting, + CreationDate: creationDate, + LastEditedDate: lastEditedDate, + } +} + +// NewEntities returns a new Entities instance +func NewEntities(hashtags []Tag, mentions []Tag, urls []Url) *Entities { + return &Entities{ + Hashtags: hashtags, + Mentions: mentions, + Urls: urls, + } +} + +// NewTag returns a new Tag instance +func NewTag(start, end uint64, tag string) Tag { + return Tag{ + Start: start, + End: end, + Tag: tag, + } +} + +// NewURL returns a new Url instance +func NewURL(start, end uint64, url, displayURL string) Url { + return Url{ + Start: start, + End: end, + Url: url, + DisplayUrl: displayURL, + } +} + +// NewPostReference returns a new PostReference instance +func NewPostReference(referenceType PostReferenceType, postID uint64, position uint64) PostReference { + return PostReference{ + Type: referenceType, + PostID: postID, + Position: position, + } +} diff --git a/x/posts/legacy/v2/models.pb.go b/x/posts/legacy/v2/models.pb.go new file mode 100644 index 0000000000..b93b270e34 --- /dev/null +++ b/x/posts/legacy/v2/models.pb.go @@ -0,0 +1,4709 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/posts/v1/models.proto + +package v2 + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PostReferenceType represents the different types of references +type PostReferenceType int32 + +const ( + // No reference specified + POST_REFERENCE_TYPE_UNSPECIFIED PostReferenceType = 0 + // This reference represents a reply to the specified post + POST_REFERENCE_TYPE_REPLY PostReferenceType = 1 + // This reference represents a quote of the specified post + POST_REFERENCE_TYPE_QUOTE PostReferenceType = 2 + // This reference represents a repost of the specified post + POST_REFERENCE_TYPE_REPOST PostReferenceType = 3 +) + +var PostReferenceType_name = map[int32]string{ + 0: "POST_REFERENCE_TYPE_UNSPECIFIED", + 1: "POST_REFERENCE_TYPE_REPLY", + 2: "POST_REFERENCE_TYPE_QUOTE", + 3: "POST_REFERENCE_TYPE_REPOST", +} + +var PostReferenceType_value = map[string]int32{ + "POST_REFERENCE_TYPE_UNSPECIFIED": 0, + "POST_REFERENCE_TYPE_REPLY": 1, + "POST_REFERENCE_TYPE_QUOTE": 2, + "POST_REFERENCE_TYPE_REPOST": 3, +} + +func (x PostReferenceType) String() string { + return proto.EnumName(PostReferenceType_name, int32(x)) +} + +func (PostReferenceType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{0} +} + +// ReplySetting contains the possible reply settings that a post can have +type ReplySetting int32 + +const ( + // No reply setting specified + REPLY_SETTING_UNSPECIFIED ReplySetting = 0 + // Everyone will be able to reply to this post + REPLY_SETTING_EVERYONE ReplySetting = 1 + // Only followers of the author will be able to reply to this post + REPLY_SETTING_FOLLOWERS ReplySetting = 2 + // Only the author mutual followers will be able to reply to this post + REPLY_SETTING_MUTUAL ReplySetting = 3 + // Only people mentioned inside this post will be able to reply + REPLY_SETTING_MENTIONS ReplySetting = 4 +) + +var ReplySetting_name = map[int32]string{ + 0: "REPLY_SETTING_UNSPECIFIED", + 1: "REPLY_SETTING_EVERYONE", + 2: "REPLY_SETTING_FOLLOWERS", + 3: "REPLY_SETTING_MUTUAL", + 4: "REPLY_SETTING_MENTIONS", +} + +var ReplySetting_value = map[string]int32{ + "REPLY_SETTING_UNSPECIFIED": 0, + "REPLY_SETTING_EVERYONE": 1, + "REPLY_SETTING_FOLLOWERS": 2, + "REPLY_SETTING_MUTUAL": 3, + "REPLY_SETTING_MENTIONS": 4, +} + +func (x ReplySetting) String() string { + return proto.EnumName(ReplySetting_name, int32(x)) +} + +func (ReplySetting) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{1} +} + +// Post contains all the information about a single post +type Post struct { + // Id of the subspace inside which the post has been created + SubspaceID uint64 `protobuf:"varint,1,opt,name=subspace_id,json=subspaceId,proto3" json:"subspace_id,omitempty"` + // Id of the section inside which the post has been created + SectionID uint32 `protobuf:"varint,2,opt,name=section_id,json=sectionId,proto3" json:"section_id,omitempty"` + // Unique id of the post + ID uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + // (optional) External id for this post + ExternalID string `protobuf:"bytes,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // (optional) Text of the post + Text string `protobuf:"bytes,5,opt,name=text,proto3" json:"text,omitempty"` + // (optional) Entities connected to this post + Entities *Entities `protobuf:"bytes,6,opt,name=entities,proto3" json:"entities,omitempty"` + // Author of the post + Author string `protobuf:"bytes,7,opt,name=author,proto3" json:"author,omitempty"` + // (optional) Id of the original post of the conversation + ConversationID uint64 `protobuf:"varint,8,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` + // A list this posts references (either as a reply, repost or quote) + ReferencedPosts []PostReference `protobuf:"bytes,9,rep,name=referenced_posts,json=referencedPosts,proto3" json:"referenced_posts"` + // Reply settings of this post + ReplySettings ReplySetting `protobuf:"varint,10,opt,name=reply_settings,json=replySettings,proto3,enum=desmos.posts.v1.ReplySetting" json:"reply_settings,omitempty"` + // Creation date of the post + CreationDate time.Time `protobuf:"bytes,11,opt,name=creation_date,json=creationDate,proto3,stdtime" json:"creation_date"` + // (optional) Last edited time of the post + LastEditedDate *time.Time `protobuf:"bytes,12,opt,name=last_edited_date,json=lastEditedDate,proto3,stdtime" json:"last_edited_date,omitempty"` +} + +func (m *Post) Reset() { *m = Post{} } +func (m *Post) String() string { return proto.CompactTextString(m) } +func (*Post) ProtoMessage() {} +func (*Post) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{0} +} +func (m *Post) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Post) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Post.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Post) XXX_Merge(src proto.Message) { + xxx_messageInfo_Post.Merge(m, src) +} +func (m *Post) XXX_Size() int { + return m.Size() +} +func (m *Post) XXX_DiscardUnknown() { + xxx_messageInfo_Post.DiscardUnknown(m) +} + +var xxx_messageInfo_Post proto.InternalMessageInfo + +func (m *Post) GetSubspaceID() uint64 { + if m != nil { + return m.SubspaceID + } + return 0 +} + +func (m *Post) GetSectionID() uint32 { + if m != nil { + return m.SectionID + } + return 0 +} + +func (m *Post) GetID() uint64 { + if m != nil { + return m.ID + } + return 0 +} + +func (m *Post) GetExternalID() string { + if m != nil { + return m.ExternalID + } + return "" +} + +func (m *Post) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +func (m *Post) GetEntities() *Entities { + if m != nil { + return m.Entities + } + return nil +} + +func (m *Post) GetAuthor() string { + if m != nil { + return m.Author + } + return "" +} + +func (m *Post) GetConversationID() uint64 { + if m != nil { + return m.ConversationID + } + return 0 +} + +func (m *Post) GetReferencedPosts() []PostReference { + if m != nil { + return m.ReferencedPosts + } + return nil +} + +func (m *Post) GetReplySettings() ReplySetting { + if m != nil { + return m.ReplySettings + } + return REPLY_SETTING_UNSPECIFIED +} + +func (m *Post) GetCreationDate() time.Time { + if m != nil { + return m.CreationDate + } + return time.Time{} +} + +func (m *Post) GetLastEditedDate() *time.Time { + if m != nil { + return m.LastEditedDate + } + return nil +} + +// PostReference contains the details of a post reference +type PostReference struct { + // Type of reference + Type PostReferenceType `protobuf:"varint,1,opt,name=type,proto3,enum=desmos.posts.v1.PostReferenceType" json:"type,omitempty"` + // Id of the referenced post + PostID uint64 `protobuf:"varint,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` + // Position of the reference inside the post's text. This should be used only + // with the type set to TYPE_QUOTE + Position uint64 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` +} + +func (m *PostReference) Reset() { *m = PostReference{} } +func (m *PostReference) String() string { return proto.CompactTextString(m) } +func (*PostReference) ProtoMessage() {} +func (*PostReference) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{1} +} +func (m *PostReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PostReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PostReference.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PostReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_PostReference.Merge(m, src) +} +func (m *PostReference) XXX_Size() int { + return m.Size() +} +func (m *PostReference) XXX_DiscardUnknown() { + xxx_messageInfo_PostReference.DiscardUnknown(m) +} + +var xxx_messageInfo_PostReference proto.InternalMessageInfo + +func (m *PostReference) GetType() PostReferenceType { + if m != nil { + return m.Type + } + return POST_REFERENCE_TYPE_UNSPECIFIED +} + +func (m *PostReference) GetPostID() uint64 { + if m != nil { + return m.PostID + } + return 0 +} + +func (m *PostReference) GetPosition() uint64 { + if m != nil { + return m.Position + } + return 0 +} + +// Contains the details of entities parsed out of the post text +type Entities struct { + Hashtags []Tag `protobuf:"bytes,1,rep,name=hashtags,proto3" json:"hashtags"` + Mentions []Tag `protobuf:"bytes,2,rep,name=mentions,proto3" json:"mentions"` + Urls []Url `protobuf:"bytes,3,rep,name=urls,proto3" json:"urls"` +} + +func (m *Entities) Reset() { *m = Entities{} } +func (m *Entities) String() string { return proto.CompactTextString(m) } +func (*Entities) ProtoMessage() {} +func (*Entities) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{2} +} +func (m *Entities) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Entities) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Entities.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Entities) XXX_Merge(src proto.Message) { + xxx_messageInfo_Entities.Merge(m, src) +} +func (m *Entities) XXX_Size() int { + return m.Size() +} +func (m *Entities) XXX_DiscardUnknown() { + xxx_messageInfo_Entities.DiscardUnknown(m) +} + +var xxx_messageInfo_Entities proto.InternalMessageInfo + +func (m *Entities) GetHashtags() []Tag { + if m != nil { + return m.Hashtags + } + return nil +} + +func (m *Entities) GetMentions() []Tag { + if m != nil { + return m.Mentions + } + return nil +} + +func (m *Entities) GetUrls() []Url { + if m != nil { + return m.Urls + } + return nil +} + +// Tag represents a generic tag +type Tag struct { + // Index of the character inside the text at which the tag starts + Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + // Index of the character inside the text at which the tag ends + End uint64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` + // Tag reference (user address, hashtag value, etc) + Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"` +} + +func (m *Tag) Reset() { *m = Tag{} } +func (m *Tag) String() string { return proto.CompactTextString(m) } +func (*Tag) ProtoMessage() {} +func (*Tag) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{3} +} +func (m *Tag) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Tag.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Tag) XXX_Merge(src proto.Message) { + xxx_messageInfo_Tag.Merge(m, src) +} +func (m *Tag) XXX_Size() int { + return m.Size() +} +func (m *Tag) XXX_DiscardUnknown() { + xxx_messageInfo_Tag.DiscardUnknown(m) +} + +var xxx_messageInfo_Tag proto.InternalMessageInfo + +func (m *Tag) GetStart() uint64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Tag) GetEnd() uint64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *Tag) GetTag() string { + if m != nil { + return m.Tag + } + return "" +} + +// Url contains the details of a generic URL +type Url struct { + // Index of the character inside the text at which the URL starts + Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + // Index of the character inside the text at which the URL ends + End uint64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` + // Value of the URL where the user should be redirected to + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` + // (optional) Display value of the URL + DisplayUrl string `protobuf:"bytes,4,opt,name=display_url,json=displayUrl,proto3" json:"display_url,omitempty"` +} + +func (m *Url) Reset() { *m = Url{} } +func (m *Url) String() string { return proto.CompactTextString(m) } +func (*Url) ProtoMessage() {} +func (*Url) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{4} +} +func (m *Url) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Url) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Url.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Url) XXX_Merge(src proto.Message) { + xxx_messageInfo_Url.Merge(m, src) +} +func (m *Url) XXX_Size() int { + return m.Size() +} +func (m *Url) XXX_DiscardUnknown() { + xxx_messageInfo_Url.DiscardUnknown(m) +} + +var xxx_messageInfo_Url proto.InternalMessageInfo + +func (m *Url) GetStart() uint64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Url) GetEnd() uint64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *Url) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *Url) GetDisplayUrl() string { + if m != nil { + return m.DisplayUrl + } + return "" +} + +// Attachment contains the data of a single post attachment +type Attachment struct { + // Id of the subspace inside which the post to which this attachment should be + // connected is + SubspaceID uint64 `protobuf:"varint,1,opt,name=subspace_id,json=subspaceId,proto3" json:"subspace_id,omitempty"` + // Id of the subspace section inside which the post to which this attachment + // should be connected is + SectionID uint32 `protobuf:"varint,2,opt,name=section_id,json=sectionId,proto3" json:"section_id,omitempty"` + // Id of the post to which this attachment should be connected + PostID uint64 `protobuf:"varint,3,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` + // If of this attachment + ID uint32 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` + // Content of the attachment + Content *types.Any `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` +} + +func (m *Attachment) Reset() { *m = Attachment{} } +func (m *Attachment) String() string { return proto.CompactTextString(m) } +func (*Attachment) ProtoMessage() {} +func (*Attachment) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{5} +} +func (m *Attachment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Attachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Attachment.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Attachment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Attachment.Merge(m, src) +} +func (m *Attachment) XXX_Size() int { + return m.Size() +} +func (m *Attachment) XXX_DiscardUnknown() { + xxx_messageInfo_Attachment.DiscardUnknown(m) +} + +var xxx_messageInfo_Attachment proto.InternalMessageInfo + +func (m *Attachment) GetSubspaceID() uint64 { + if m != nil { + return m.SubspaceID + } + return 0 +} + +func (m *Attachment) GetSectionID() uint32 { + if m != nil { + return m.SectionID + } + return 0 +} + +func (m *Attachment) GetPostID() uint64 { + if m != nil { + return m.PostID + } + return 0 +} + +func (m *Attachment) GetID() uint32 { + if m != nil { + return m.ID + } + return 0 +} + +func (m *Attachment) GetContent() *types.Any { + if m != nil { + return m.Content + } + return nil +} + +// Media represents a media attachment +type Media struct { + Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` + MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"` +} + +func (m *Media) Reset() { *m = Media{} } +func (m *Media) String() string { return proto.CompactTextString(m) } +func (*Media) ProtoMessage() {} +func (*Media) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{6} +} +func (m *Media) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Media) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Media.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Media) XXX_Merge(src proto.Message) { + xxx_messageInfo_Media.Merge(m, src) +} +func (m *Media) XXX_Size() int { + return m.Size() +} +func (m *Media) XXX_DiscardUnknown() { + xxx_messageInfo_Media.DiscardUnknown(m) +} + +var xxx_messageInfo_Media proto.InternalMessageInfo + +func (m *Media) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *Media) GetMimeType() string { + if m != nil { + return m.MimeType + } + return "" +} + +// Poll represents a poll attachment +type Poll struct { + // Question of the poll + Question string `protobuf:"bytes,1,opt,name=question,proto3" json:"question,omitempty"` + // Answers the users can choose from + ProvidedAnswers []Poll_ProvidedAnswer `protobuf:"bytes,2,rep,name=provided_answers,json=providedAnswers,proto3" json:"provided_answers"` + // Date at which the poll will close + EndDate time.Time `protobuf:"bytes,3,opt,name=end_date,json=endDate,proto3,stdtime" json:"end_date"` + // Whether the poll allows multiple choices from the same user or not + AllowsMultipleAnswers bool `protobuf:"varint,4,opt,name=allows_multiple_answers,json=allowsMultipleAnswers,proto3" json:"allows_multiple_answers,omitempty"` + // Whether the poll allows to edit an answer or not + AllowsAnswerEdits bool `protobuf:"varint,5,opt,name=allows_answer_edits,json=allowsAnswerEdits,proto3" json:"allows_answer_edits,omitempty"` + // Final poll results + FinalTallyResults *PollTallyResults `protobuf:"bytes,6,opt,name=final_tally_results,json=finalTallyResults,proto3" json:"final_tally_results,omitempty"` +} + +func (m *Poll) Reset() { *m = Poll{} } +func (m *Poll) String() string { return proto.CompactTextString(m) } +func (*Poll) ProtoMessage() {} +func (*Poll) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{7} +} +func (m *Poll) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Poll) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Poll.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Poll) XXX_Merge(src proto.Message) { + xxx_messageInfo_Poll.Merge(m, src) +} +func (m *Poll) XXX_Size() int { + return m.Size() +} +func (m *Poll) XXX_DiscardUnknown() { + xxx_messageInfo_Poll.DiscardUnknown(m) +} + +var xxx_messageInfo_Poll proto.InternalMessageInfo + +func (m *Poll) GetQuestion() string { + if m != nil { + return m.Question + } + return "" +} + +func (m *Poll) GetProvidedAnswers() []Poll_ProvidedAnswer { + if m != nil { + return m.ProvidedAnswers + } + return nil +} + +func (m *Poll) GetEndDate() time.Time { + if m != nil { + return m.EndDate + } + return time.Time{} +} + +func (m *Poll) GetAllowsMultipleAnswers() bool { + if m != nil { + return m.AllowsMultipleAnswers + } + return false +} + +func (m *Poll) GetAllowsAnswerEdits() bool { + if m != nil { + return m.AllowsAnswerEdits + } + return false +} + +func (m *Poll) GetFinalTallyResults() *PollTallyResults { + if m != nil { + return m.FinalTallyResults + } + return nil +} + +// Provided answer contains the details of a possible poll answer +type Poll_ProvidedAnswer struct { + // (optional) Text of the answer + Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` + // Attachments of the answer + Attachments []Attachment `protobuf:"bytes,2,rep,name=attachments,proto3" json:"attachments"` +} + +func (m *Poll_ProvidedAnswer) Reset() { *m = Poll_ProvidedAnswer{} } +func (m *Poll_ProvidedAnswer) String() string { return proto.CompactTextString(m) } +func (*Poll_ProvidedAnswer) ProtoMessage() {} +func (*Poll_ProvidedAnswer) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{7, 0} +} +func (m *Poll_ProvidedAnswer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Poll_ProvidedAnswer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Poll_ProvidedAnswer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Poll_ProvidedAnswer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Poll_ProvidedAnswer.Merge(m, src) +} +func (m *Poll_ProvidedAnswer) XXX_Size() int { + return m.Size() +} +func (m *Poll_ProvidedAnswer) XXX_DiscardUnknown() { + xxx_messageInfo_Poll_ProvidedAnswer.DiscardUnknown(m) +} + +var xxx_messageInfo_Poll_ProvidedAnswer proto.InternalMessageInfo + +func (m *Poll_ProvidedAnswer) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +func (m *Poll_ProvidedAnswer) GetAttachments() []Attachment { + if m != nil { + return m.Attachments + } + return nil +} + +// UserAnswer represents a user answer to a poll +type UserAnswer struct { + // Subspace id inside which the post related to this attachment is located + SubspaceID uint64 `protobuf:"varint,1,opt,name=subspace_id,json=subspaceId,proto3" json:"subspace_id,omitempty"` + // Section id inside which the post related to this attachment is located + SectionID uint32 `protobuf:"varint,2,opt,name=section_id,json=sectionId,proto3" json:"section_id,omitempty"` + // Id of the post associated to this attachment + PostID uint64 `protobuf:"varint,3,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` + // Id of the poll to which this answer is associated + PollID uint32 `protobuf:"varint,4,opt,name=poll_id,json=pollId,proto3" json:"poll_id,omitempty"` + // Indexes of the answers inside the ProvidedAnswers array + AnswersIndexes []uint32 `protobuf:"varint,5,rep,packed,name=answers_indexes,json=answersIndexes,proto3" json:"answers_indexes,omitempty"` + // Address of the user answering the poll + User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` +} + +func (m *UserAnswer) Reset() { *m = UserAnswer{} } +func (m *UserAnswer) String() string { return proto.CompactTextString(m) } +func (*UserAnswer) ProtoMessage() {} +func (*UserAnswer) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{8} +} +func (m *UserAnswer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UserAnswer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UserAnswer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UserAnswer) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserAnswer.Merge(m, src) +} +func (m *UserAnswer) XXX_Size() int { + return m.Size() +} +func (m *UserAnswer) XXX_DiscardUnknown() { + xxx_messageInfo_UserAnswer.DiscardUnknown(m) +} + +var xxx_messageInfo_UserAnswer proto.InternalMessageInfo + +func (m *UserAnswer) GetSubspaceID() uint64 { + if m != nil { + return m.SubspaceID + } + return 0 +} + +func (m *UserAnswer) GetSectionID() uint32 { + if m != nil { + return m.SectionID + } + return 0 +} + +func (m *UserAnswer) GetPostID() uint64 { + if m != nil { + return m.PostID + } + return 0 +} + +func (m *UserAnswer) GetPollID() uint32 { + if m != nil { + return m.PollID + } + return 0 +} + +func (m *UserAnswer) GetAnswersIndexes() []uint32 { + if m != nil { + return m.AnswersIndexes + } + return nil +} + +func (m *UserAnswer) GetUser() string { + if m != nil { + return m.User + } + return "" +} + +// PollTallyResults contains the tally results for a poll +type PollTallyResults struct { + Results []PollTallyResults_AnswerResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results"` +} + +func (m *PollTallyResults) Reset() { *m = PollTallyResults{} } +func (m *PollTallyResults) String() string { return proto.CompactTextString(m) } +func (*PollTallyResults) ProtoMessage() {} +func (*PollTallyResults) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{9} +} +func (m *PollTallyResults) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PollTallyResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PollTallyResults.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PollTallyResults) XXX_Merge(src proto.Message) { + xxx_messageInfo_PollTallyResults.Merge(m, src) +} +func (m *PollTallyResults) XXX_Size() int { + return m.Size() +} +func (m *PollTallyResults) XXX_DiscardUnknown() { + xxx_messageInfo_PollTallyResults.DiscardUnknown(m) +} + +var xxx_messageInfo_PollTallyResults proto.InternalMessageInfo + +func (m *PollTallyResults) GetResults() []PollTallyResults_AnswerResult { + if m != nil { + return m.Results + } + return nil +} + +// AnswerResult contains the result of a single poll provided answer +type PollTallyResults_AnswerResult struct { + // Index of the answer inside the poll's ProvidedAnswers slice + AnswerIndex uint32 `protobuf:"varint,1,opt,name=answer_index,json=answerIndex,proto3" json:"answer_index,omitempty"` + // Number of votes the answer has received + Votes uint64 `protobuf:"varint,2,opt,name=votes,proto3" json:"votes,omitempty"` +} + +func (m *PollTallyResults_AnswerResult) Reset() { *m = PollTallyResults_AnswerResult{} } +func (m *PollTallyResults_AnswerResult) String() string { return proto.CompactTextString(m) } +func (*PollTallyResults_AnswerResult) ProtoMessage() {} +func (*PollTallyResults_AnswerResult) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{9, 0} +} +func (m *PollTallyResults_AnswerResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PollTallyResults_AnswerResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PollTallyResults_AnswerResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PollTallyResults_AnswerResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_PollTallyResults_AnswerResult.Merge(m, src) +} +func (m *PollTallyResults_AnswerResult) XXX_Size() int { + return m.Size() +} +func (m *PollTallyResults_AnswerResult) XXX_DiscardUnknown() { + xxx_messageInfo_PollTallyResults_AnswerResult.DiscardUnknown(m) +} + +var xxx_messageInfo_PollTallyResults_AnswerResult proto.InternalMessageInfo + +func (m *PollTallyResults_AnswerResult) GetAnswerIndex() uint32 { + if m != nil { + return m.AnswerIndex + } + return 0 +} + +func (m *PollTallyResults_AnswerResult) GetVotes() uint64 { + if m != nil { + return m.Votes + } + return 0 +} + +// Params contains the parameters for the posts module +type Params struct { + // Maximum length of the post text + MaxTextLength uint32 `protobuf:"varint,1,opt,name=max_text_length,json=maxTextLength,proto3" json:"max_text_length,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_9cb993d391569998, []int{10} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMaxTextLength() uint32 { + if m != nil { + return m.MaxTextLength + } + return 0 +} + +func init() { + proto.RegisterEnum("desmos.posts.v1.PostReferenceType", PostReferenceType_name, PostReferenceType_value) + proto.RegisterEnum("desmos.posts.v1.ReplySetting", ReplySetting_name, ReplySetting_value) + proto.RegisterType((*Post)(nil), "desmos.posts.v1.Post") + proto.RegisterType((*PostReference)(nil), "desmos.posts.v1.PostReference") + proto.RegisterType((*Entities)(nil), "desmos.posts.v1.Entities") + proto.RegisterType((*Tag)(nil), "desmos.posts.v1.Tag") + proto.RegisterType((*Url)(nil), "desmos.posts.v1.Url") + proto.RegisterType((*Attachment)(nil), "desmos.posts.v1.Attachment") + proto.RegisterType((*Media)(nil), "desmos.posts.v1.Media") + proto.RegisterType((*Poll)(nil), "desmos.posts.v1.Poll") + proto.RegisterType((*Poll_ProvidedAnswer)(nil), "desmos.posts.v1.Poll.ProvidedAnswer") + proto.RegisterType((*UserAnswer)(nil), "desmos.posts.v1.UserAnswer") + proto.RegisterType((*PollTallyResults)(nil), "desmos.posts.v1.PollTallyResults") + proto.RegisterType((*PollTallyResults_AnswerResult)(nil), "desmos.posts.v1.PollTallyResults.AnswerResult") + proto.RegisterType((*Params)(nil), "desmos.posts.v1.Params") +} + +func init() { proto.RegisterFile("desmos/posts/v1/models.proto", fileDescriptor_9cb993d391569998) } + +var fileDescriptor_9cb993d391569998 = []byte{ + // 1352 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x3f, 0x6f, 0x1b, 0xc7, + 0x12, 0xd7, 0x89, 0x94, 0x44, 0x8d, 0x44, 0x8a, 0x5a, 0xcb, 0x36, 0x4d, 0x3f, 0x93, 0xb2, 0xfc, + 0xf0, 0x9e, 0x60, 0xc4, 0x47, 0x58, 0x49, 0x5c, 0x38, 0x45, 0x20, 0x89, 0xe7, 0xe0, 0x02, 0x49, + 0x94, 0x97, 0xc7, 0x04, 0x4e, 0x73, 0x58, 0xf1, 0xd6, 0xd4, 0x05, 0xcb, 0x3b, 0xe6, 0x76, 0x49, + 0x93, 0x5f, 0x20, 0x48, 0x3a, 0x23, 0x55, 0x8a, 0x14, 0x46, 0xf2, 0x15, 0xdc, 0xa7, 0x35, 0x52, + 0x19, 0xa9, 0x52, 0x29, 0x01, 0xdd, 0xe4, 0x2b, 0x04, 0x48, 0x11, 0xec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x2a, 0x4e, 0xa3, + 0x0a, 0x94, 0x2f, 0x88, 0x6e, 0x34, 0x9d, 0x62, 0xa6, 0x9c, 0xfd, 0xea, 0x87, 0xca, 0xd4, 0xdd, + 0xef, 0x0d, 0x58, 0x4c, 0xff, 0xbe, 0x48, 0x56, 0xb5, 0x81, 0xdb, 0xb4, 0x1c, 0xc7, 0xde, 0xfb, + 0xe8, 0x54, 0x4e, 0x65, 0xb8, 0x76, 0xd2, 0x6d, 0x7d, 0x62, 0xe1, 0x27, 0x8d, 0x3d, 0xab, 0x68, + 0xa0, 0x9b, 0x70, 0xfd, 0xa4, 0xef, 0x51, 0x63, 0x67, 0xa7, 0xf1, 0xa9, 0x85, 0x9b, 0xc5, 0x69, + 0x54, 0x82, 0x95, 0x93, 0xce, 0xdd, 0x96, 0xd3, 0xda, 0xdc, 0x29, 0x66, 0xce, 0x52, 0xee, 0x5a, + 0x7b, 0x8e, 0xdd, 0xd8, 0x6b, 0x16, 0xb3, 0x3a, 0xc9, 0xad, 0x9d, 0x57, 0xe3, 0x8a, 0xf1, 0x7a, + 0x5c, 0x31, 0x7e, 0x1b, 0x57, 0x8c, 0xe7, 0x6f, 0x2a, 0x53, 0xaf, 0xdf, 0x54, 0xa6, 0x7e, 0x79, + 0x53, 0x99, 0xfa, 0x6c, 0xa3, 0xe3, 0x8b, 0xc3, 0xfe, 0x81, 0xd9, 0x0e, 0xbb, 0x35, 0xad, 0x9f, + 0x7b, 0x8c, 0x1c, 0xf0, 0xf8, 0xbb, 0x36, 0x78, 0xaf, 0x36, 0x8c, 0xff, 0xfe, 0x19, 0xed, 0x90, + 0xf6, 0xa8, 0x36, 0xd8, 0x38, 0x98, 0x55, 0x43, 0xf0, 0xdd, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x25, 0xf7, 0x2f, 0xf2, 0x1e, 0x0c, 0x00, 0x00, +} + +func (this *Post) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Post) + if !ok { + that2, ok := that.(Post) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.SubspaceID != that1.SubspaceID { + return false + } + if this.SectionID != that1.SectionID { + return false + } + if this.ID != that1.ID { + return false + } + if this.ExternalID != that1.ExternalID { + return false + } + if this.Text != that1.Text { + return false + } + if !this.Entities.Equal(that1.Entities) { + return false + } + if this.Author != that1.Author { + return false + } + if this.ConversationID != that1.ConversationID { + return false + } + if len(this.ReferencedPosts) != len(that1.ReferencedPosts) { + return false + } + for i := range this.ReferencedPosts { + if !this.ReferencedPosts[i].Equal(&that1.ReferencedPosts[i]) { + return false + } + } + if this.ReplySettings != that1.ReplySettings { + return false + } + if !this.CreationDate.Equal(that1.CreationDate) { + return false + } + if that1.LastEditedDate == nil { + if this.LastEditedDate != nil { + return false + } + } else if !this.LastEditedDate.Equal(*that1.LastEditedDate) { + return false + } + return true +} +func (this *PostReference) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PostReference) + if !ok { + that2, ok := that.(PostReference) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Type != that1.Type { + return false + } + if this.PostID != that1.PostID { + return false + } + if this.Position != that1.Position { + return false + } + return true +} +func (this *Entities) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Entities) + if !ok { + that2, ok := that.(Entities) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Hashtags) != len(that1.Hashtags) { + return false + } + for i := range this.Hashtags { + if !this.Hashtags[i].Equal(&that1.Hashtags[i]) { + return false + } + } + if len(this.Mentions) != len(that1.Mentions) { + return false + } + for i := range this.Mentions { + if !this.Mentions[i].Equal(&that1.Mentions[i]) { + return false + } + } + if len(this.Urls) != len(that1.Urls) { + return false + } + for i := range this.Urls { + if !this.Urls[i].Equal(&that1.Urls[i]) { + return false + } + } + return true +} +func (this *Tag) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Tag) + if !ok { + that2, ok := that.(Tag) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Start != that1.Start { + return false + } + if this.End != that1.End { + return false + } + if this.Tag != that1.Tag { + return false + } + return true +} +func (this *Url) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Url) + if !ok { + that2, ok := that.(Url) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Start != that1.Start { + return false + } + if this.End != that1.End { + return false + } + if this.Url != that1.Url { + return false + } + if this.DisplayUrl != that1.DisplayUrl { + return false + } + return true +} +func (this *Attachment) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Attachment) + if !ok { + that2, ok := that.(Attachment) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.SubspaceID != that1.SubspaceID { + return false + } + if this.SectionID != that1.SectionID { + return false + } + if this.PostID != that1.PostID { + return false + } + if this.ID != that1.ID { + return false + } + if !this.Content.Equal(that1.Content) { + return false + } + return true +} +func (this *Media) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Media) + if !ok { + that2, ok := that.(Media) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Uri != that1.Uri { + return false + } + if this.MimeType != that1.MimeType { + return false + } + return true +} +func (this *Poll) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Poll) + if !ok { + that2, ok := that.(Poll) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Question != that1.Question { + return false + } + if len(this.ProvidedAnswers) != len(that1.ProvidedAnswers) { + return false + } + for i := range this.ProvidedAnswers { + if !this.ProvidedAnswers[i].Equal(&that1.ProvidedAnswers[i]) { + return false + } + } + if !this.EndDate.Equal(that1.EndDate) { + return false + } + if this.AllowsMultipleAnswers != that1.AllowsMultipleAnswers { + return false + } + if this.AllowsAnswerEdits != that1.AllowsAnswerEdits { + return false + } + if !this.FinalTallyResults.Equal(that1.FinalTallyResults) { + return false + } + return true +} +func (this *Poll_ProvidedAnswer) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Poll_ProvidedAnswer) + if !ok { + that2, ok := that.(Poll_ProvidedAnswer) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Text != that1.Text { + return false + } + if len(this.Attachments) != len(that1.Attachments) { + return false + } + for i := range this.Attachments { + if !this.Attachments[i].Equal(&that1.Attachments[i]) { + return false + } + } + return true +} +func (this *UserAnswer) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*UserAnswer) + if !ok { + that2, ok := that.(UserAnswer) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.SubspaceID != that1.SubspaceID { + return false + } + if this.SectionID != that1.SectionID { + return false + } + if this.PostID != that1.PostID { + return false + } + if this.PollID != that1.PollID { + return false + } + if len(this.AnswersIndexes) != len(that1.AnswersIndexes) { + return false + } + for i := range this.AnswersIndexes { + if this.AnswersIndexes[i] != that1.AnswersIndexes[i] { + return false + } + } + if this.User != that1.User { + return false + } + return true +} +func (this *PollTallyResults) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PollTallyResults) + if !ok { + that2, ok := that.(PollTallyResults) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Results) != len(that1.Results) { + return false + } + for i := range this.Results { + if !this.Results[i].Equal(&that1.Results[i]) { + return false + } + } + return true +} +func (this *PollTallyResults_AnswerResult) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PollTallyResults_AnswerResult) + if !ok { + that2, ok := that.(PollTallyResults_AnswerResult) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.AnswerIndex != that1.AnswerIndex { + return false + } + if this.Votes != that1.Votes { + return false + } + return true +} +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.MaxTextLength != that1.MaxTextLength { + return false + } + return true +} +func (m *Post) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Post) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Post) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LastEditedDate != nil { + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.LastEditedDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.LastEditedDate):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModels(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x62 + } + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationDate):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintModels(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x5a + if m.ReplySettings != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.ReplySettings)) + i-- + dAtA[i] = 0x50 + } + if len(m.ReferencedPosts) > 0 { + for iNdEx := len(m.ReferencedPosts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ReferencedPosts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.ConversationID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.ConversationID)) + i-- + dAtA[i] = 0x40 + } + if len(m.Author) > 0 { + i -= len(m.Author) + copy(dAtA[i:], m.Author) + i = encodeVarintModels(dAtA, i, uint64(len(m.Author))) + i-- + dAtA[i] = 0x3a + } + if m.Entities != nil { + { + size, err := m.Entities.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Text) > 0 { + i -= len(m.Text) + copy(dAtA[i:], m.Text) + i = encodeVarintModels(dAtA, i, uint64(len(m.Text))) + i-- + dAtA[i] = 0x2a + } + if len(m.ExternalID) > 0 { + i -= len(m.ExternalID) + copy(dAtA[i:], m.ExternalID) + i = encodeVarintModels(dAtA, i, uint64(len(m.ExternalID))) + i-- + dAtA[i] = 0x22 + } + if m.ID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x18 + } + if m.SectionID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.SectionID)) + i-- + dAtA[i] = 0x10 + } + if m.SubspaceID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.SubspaceID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PostReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PostReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Position != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Position)) + i-- + dAtA[i] = 0x18 + } + if m.PostID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.PostID)) + i-- + dAtA[i] = 0x10 + } + if m.Type != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Entities) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Entities) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Entities) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Urls) > 0 { + for iNdEx := len(m.Urls) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Urls[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Mentions) > 0 { + for iNdEx := len(m.Mentions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Mentions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Hashtags) > 0 { + for iNdEx := len(m.Hashtags) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Hashtags[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Tag) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Tag) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Tag) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Tag) > 0 { + i -= len(m.Tag) + copy(dAtA[i:], m.Tag) + i = encodeVarintModels(dAtA, i, uint64(len(m.Tag))) + i-- + dAtA[i] = 0x1a + } + if m.End != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.End)) + i-- + dAtA[i] = 0x10 + } + if m.Start != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Start)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Url) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Url) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Url) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DisplayUrl) > 0 { + i -= len(m.DisplayUrl) + copy(dAtA[i:], m.DisplayUrl) + i = encodeVarintModels(dAtA, i, uint64(len(m.DisplayUrl))) + i-- + dAtA[i] = 0x22 + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintModels(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x1a + } + if m.End != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.End)) + i-- + dAtA[i] = 0x10 + } + if m.Start != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Start)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Attachment) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Attachment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Attachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Content != nil { + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x20 + } + if m.PostID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.PostID)) + i-- + dAtA[i] = 0x18 + } + if m.SectionID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.SectionID)) + i-- + dAtA[i] = 0x10 + } + if m.SubspaceID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.SubspaceID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Media) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Media) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Media) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MimeType) > 0 { + i -= len(m.MimeType) + copy(dAtA[i:], m.MimeType) + i = encodeVarintModels(dAtA, i, uint64(len(m.MimeType))) + i-- + dAtA[i] = 0x1a + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintModels(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *Poll) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Poll) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Poll) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FinalTallyResults != nil { + { + size, err := m.FinalTallyResults.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.AllowsAnswerEdits { + i-- + if m.AllowsAnswerEdits { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.AllowsMultipleAnswers { + i-- + if m.AllowsMultipleAnswers { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndDate):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintModels(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x1a + if len(m.ProvidedAnswers) > 0 { + for iNdEx := len(m.ProvidedAnswers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProvidedAnswers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Question) > 0 { + i -= len(m.Question) + copy(dAtA[i:], m.Question) + i = encodeVarintModels(dAtA, i, uint64(len(m.Question))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Poll_ProvidedAnswer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Poll_ProvidedAnswer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Poll_ProvidedAnswer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Attachments) > 0 { + for iNdEx := len(m.Attachments) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attachments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Text) > 0 { + i -= len(m.Text) + copy(dAtA[i:], m.Text) + i = encodeVarintModels(dAtA, i, uint64(len(m.Text))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UserAnswer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserAnswer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserAnswer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintModels(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0x32 + } + if len(m.AnswersIndexes) > 0 { + dAtA8 := make([]byte, len(m.AnswersIndexes)*10) + var j7 int + for _, num := range m.AnswersIndexes { + for num >= 1<<7 { + dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j7++ + } + dAtA8[j7] = uint8(num) + j7++ + } + i -= j7 + copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintModels(dAtA, i, uint64(j7)) + i-- + dAtA[i] = 0x2a + } + if m.PollID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.PollID)) + i-- + dAtA[i] = 0x20 + } + if m.PostID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.PostID)) + i-- + dAtA[i] = 0x18 + } + if m.SectionID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.SectionID)) + i-- + dAtA[i] = 0x10 + } + if m.SubspaceID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.SubspaceID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PollTallyResults) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PollTallyResults) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PollTallyResults) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PollTallyResults_AnswerResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PollTallyResults_AnswerResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PollTallyResults_AnswerResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Votes != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Votes)) + i-- + dAtA[i] = 0x10 + } + if m.AnswerIndex != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.AnswerIndex)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxTextLength != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.MaxTextLength)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintModels(dAtA []byte, offset int, v uint64) int { + offset -= sovModels(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Post) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SubspaceID != 0 { + n += 1 + sovModels(uint64(m.SubspaceID)) + } + if m.SectionID != 0 { + n += 1 + sovModels(uint64(m.SectionID)) + } + if m.ID != 0 { + n += 1 + sovModels(uint64(m.ID)) + } + l = len(m.ExternalID) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Text) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if m.Entities != nil { + l = m.Entities.Size() + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Author) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if m.ConversationID != 0 { + n += 1 + sovModels(uint64(m.ConversationID)) + } + if len(m.ReferencedPosts) > 0 { + for _, e := range m.ReferencedPosts { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + if m.ReplySettings != 0 { + n += 1 + sovModels(uint64(m.ReplySettings)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationDate) + n += 1 + l + sovModels(uint64(l)) + if m.LastEditedDate != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.LastEditedDate) + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *PostReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovModels(uint64(m.Type)) + } + if m.PostID != 0 { + n += 1 + sovModels(uint64(m.PostID)) + } + if m.Position != 0 { + n += 1 + sovModels(uint64(m.Position)) + } + return n +} + +func (m *Entities) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Hashtags) > 0 { + for _, e := range m.Hashtags { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + if len(m.Mentions) > 0 { + for _, e := range m.Mentions { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + if len(m.Urls) > 0 { + for _, e := range m.Urls { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *Tag) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Start != 0 { + n += 1 + sovModels(uint64(m.Start)) + } + if m.End != 0 { + n += 1 + sovModels(uint64(m.End)) + } + l = len(m.Tag) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *Url) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Start != 0 { + n += 1 + sovModels(uint64(m.Start)) + } + if m.End != 0 { + n += 1 + sovModels(uint64(m.End)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.DisplayUrl) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *Attachment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SubspaceID != 0 { + n += 1 + sovModels(uint64(m.SubspaceID)) + } + if m.SectionID != 0 { + n += 1 + sovModels(uint64(m.SectionID)) + } + if m.PostID != 0 { + n += 1 + sovModels(uint64(m.PostID)) + } + if m.ID != 0 { + n += 1 + sovModels(uint64(m.ID)) + } + if m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *Media) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.MimeType) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *Poll) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Question) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if len(m.ProvidedAnswers) > 0 { + for _, e := range m.ProvidedAnswers { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndDate) + n += 1 + l + sovModels(uint64(l)) + if m.AllowsMultipleAnswers { + n += 2 + } + if m.AllowsAnswerEdits { + n += 2 + } + if m.FinalTallyResults != nil { + l = m.FinalTallyResults.Size() + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *Poll_ProvidedAnswer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Text) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if len(m.Attachments) > 0 { + for _, e := range m.Attachments { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *UserAnswer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SubspaceID != 0 { + n += 1 + sovModels(uint64(m.SubspaceID)) + } + if m.SectionID != 0 { + n += 1 + sovModels(uint64(m.SectionID)) + } + if m.PostID != 0 { + n += 1 + sovModels(uint64(m.PostID)) + } + if m.PollID != 0 { + n += 1 + sovModels(uint64(m.PollID)) + } + if len(m.AnswersIndexes) > 0 { + l = 0 + for _, e := range m.AnswersIndexes { + l += sovModels(uint64(e)) + } + n += 1 + sovModels(uint64(l)) + l + } + l = len(m.User) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *PollTallyResults) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *PollTallyResults_AnswerResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AnswerIndex != 0 { + n += 1 + sovModels(uint64(m.AnswerIndex)) + } + if m.Votes != 0 { + n += 1 + sovModels(uint64(m.Votes)) + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxTextLength != 0 { + n += 1 + sovModels(uint64(m.MaxTextLength)) + } + return n +} + +func sovModels(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModels(x uint64) (n int) { + return sovModels(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Post) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Post: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Post: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SubspaceID", wireType) + } + m.SubspaceID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SubspaceID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SectionID", wireType) + } + m.SectionID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SectionID |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExternalID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Text = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entities == nil { + m.Entities = &Entities{} + } + if err := m.Entities.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Author", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Author = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ConversationID", wireType) + } + m.ConversationID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ConversationID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReferencedPosts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReferencedPosts = append(m.ReferencedPosts, PostReference{}) + if err := m.ReferencedPosts[len(m.ReferencedPosts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReplySettings", wireType) + } + m.ReplySettings = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReplySettings |= ReplySetting(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastEditedDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastEditedDate == nil { + m.LastEditedDate = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.LastEditedDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= PostReferenceType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostID", wireType) + } + m.PostID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + m.Position = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Position |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Entities) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Entities: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entities: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hashtags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hashtags = append(m.Hashtags, Tag{}) + if err := m.Hashtags[len(m.Hashtags)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mentions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mentions = append(m.Mentions, Tag{}) + if err := m.Mentions[len(m.Mentions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Urls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Urls = append(m.Urls, Url{}) + if err := m.Urls[len(m.Urls)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Tag) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Tag: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Tag: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + m.Start = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Start |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + m.End = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.End |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Url) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Url: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Url: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + m.Start = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Start |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + m.End = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.End |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DisplayUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Attachment) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Attachment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Attachment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SubspaceID", wireType) + } + m.SubspaceID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SubspaceID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SectionID", wireType) + } + m.SectionID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SectionID |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostID", wireType) + } + m.PostID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Content == nil { + m.Content = &types.Any{} + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Media) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Media: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Media: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MimeType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MimeType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Poll) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Poll: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Poll: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Question", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Question = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProvidedAnswers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProvidedAnswers = append(m.ProvidedAnswers, Poll_ProvidedAnswer{}) + if err := m.ProvidedAnswers[len(m.ProvidedAnswers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowsMultipleAnswers", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowsMultipleAnswers = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowsAnswerEdits", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowsAnswerEdits = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FinalTallyResults == nil { + m.FinalTallyResults = &PollTallyResults{} + } + if err := m.FinalTallyResults.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Poll_ProvidedAnswer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProvidedAnswer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProvidedAnswer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Text = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attachments", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attachments = append(m.Attachments, Attachment{}) + if err := m.Attachments[len(m.Attachments)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserAnswer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UserAnswer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserAnswer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SubspaceID", wireType) + } + m.SubspaceID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SubspaceID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SectionID", wireType) + } + m.SectionID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SectionID |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostID", wireType) + } + m.PostID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PollID", wireType) + } + m.PollID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PollID |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AnswersIndexes = append(m.AnswersIndexes, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.AnswersIndexes) == 0 { + m.AnswersIndexes = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AnswersIndexes = append(m.AnswersIndexes, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field AnswersIndexes", wireType) + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PollTallyResults) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PollTallyResults: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PollTallyResults: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Results = append(m.Results, PollTallyResults_AnswerResult{}) + if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PollTallyResults_AnswerResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AnswerResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AnswerResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AnswerIndex", wireType) + } + m.AnswerIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AnswerIndex |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) + } + m.Votes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Votes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTextLength", wireType) + } + m.MaxTextLength = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTextLength |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModels(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModels + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModels + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModels + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthModels + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModels + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModels + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModels = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModels = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModels = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/posts/legacy/v3/store.go b/x/posts/legacy/v3/store.go new file mode 100644 index 0000000000..55a8c4ee36 --- /dev/null +++ b/x/posts/legacy/v3/store.go @@ -0,0 +1,155 @@ +package v3 + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + + v2 "github.com/desmos-labs/desmos/v4/x/posts/legacy/v2" + "github.com/desmos-labs/desmos/v4/x/posts/types" +) + +// MigrateStore performs in-place store migrations from v2 to v3 +// The only thing done here is migrating the posts from v2 to v3 to add the tags. +func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec) error { + store := ctx.KVStore(storeKey) + + // Migrate all the posts + return migratePosts(store, cdc) +} + +// migratePosts migrates the posts preset inside the store from v2 to v3 +func migratePosts(store sdk.KVStore, cdc codec.BinaryCodec) error { + prefixStore := prefix.NewStore(store, types.PostPrefix) + iterator := prefixStore.Iterator(nil, nil) + + // Get all the posts + var v2Posts []v2.Post + for ; iterator.Valid(); iterator.Next() { + var v2Post v2.Post + cdc.MustUnmarshal(iterator.Value(), &v2Post) + v2Posts = append(v2Posts, v2Post) + } + + // Close the iterator + err := iterator.Close() + if err != nil { + return err + } + + // Convert the posts + for _, v2Post := range v2Posts { + v3Post := types.NewPost( + v2Post.SubspaceID, + v2Post.SectionID, + v2Post.ID, + v2Post.ExternalID, + v2Post.Text, + v2Post.Author, + v2Post.ConversationID, + migrateEntities(v2Post.Entities), + nil, + migratePostReferences(v2Post.ReferencedPosts), + migrateReplySettings(v2Post.ReplySettings), + v2Post.CreationDate, + v2Post.LastEditedDate, + ) + + // Save the post + store.Set(types.PostStoreKey(v3Post.SubspaceID, v3Post.ID), cdc.MustMarshal(&v3Post)) + } + + return nil +} + +// migrateEntities migrates the given entities from v2 to v3 +func migrateEntities(v2Entities *v2.Entities) *types.Entities { + if v2Entities == nil { + return nil + } + + return types.NewEntities( + migrateTags(v2Entities.Hashtags), + migrateTags(v2Entities.Mentions), + migrateUrls(v2Entities.Urls), + ) +} + +// migrateTags migrates the given tags from v2 to v3 +func migrateTags(v2Tags []v2.Tag) []types.TextTag { + if v2Tags == nil { + return nil + } + + v3Tags := make([]types.TextTag, len(v2Tags)) + for i, v2Tag := range v2Tags { + v3Tags[i] = types.NewTextTag(v2Tag.Start, v2Tag.End, v2Tag.Tag) + } + return v3Tags +} + +// migrateUrls migrates the given urls from v2 to v3 +func migrateUrls(v2Urls []v2.Url) []types.Url { + if v2Urls == nil { + return nil + } + + v3Urls := make([]types.Url, len(v2Urls)) + for i, v2Url := range v2Urls { + v3Urls[i] = types.NewURL(v2Url.Start, v2Url.End, v2Url.Url, v2Url.DisplayUrl) + } + return v3Urls +} + +// migratePostReferences migrates the given references from v2 to v3 +func migratePostReferences(v2References []v2.PostReference) []types.PostReference { + if v2References == nil { + return nil + } + + v3References := make([]types.PostReference, len(v2References)) + for i, v2Reference := range v2References { + v3References[i] = types.NewPostReference( + migratePostReferenceType(v2Reference.Type), + v2Reference.PostID, + v2Reference.Position, + ) + } + return v3References +} + +// migratePostReferenceType migrates the given post reference type from v2 to v3 +func migratePostReferenceType(v2Type v2.PostReferenceType) types.PostReferenceType { + switch v2Type { + case v2.POST_REFERENCE_TYPE_UNSPECIFIED: + return types.POST_REFERENCE_TYPE_UNSPECIFIED + case v2.POST_REFERENCE_TYPE_REPLY: + return types.POST_REFERENCE_TYPE_REPLY + case v2.POST_REFERENCE_TYPE_QUOTE: + return types.POST_REFERENCE_TYPE_QUOTE + case v2.POST_REFERENCE_TYPE_REPOST: + return types.POST_REFERENCE_TYPE_REPOST + default: + panic(fmt.Errorf("invalid post reference type: %s", v2Type)) + } +} + +// migrateReplySettings migrates the given reply setting from v2 to v3 +func migrateReplySettings(settings v2.ReplySetting) types.ReplySetting { + switch settings { + case v2.REPLY_SETTING_UNSPECIFIED: + return types.REPLY_SETTING_UNSPECIFIED + case v2.REPLY_SETTING_EVERYONE: + return types.REPLY_SETTING_EVERYONE + case v2.REPLY_SETTING_FOLLOWERS: + return types.REPLY_SETTING_FOLLOWERS + case v2.REPLY_SETTING_MUTUAL: + return types.REPLY_SETTING_MUTUAL + case v2.REPLY_SETTING_MENTIONS: + return types.REPLY_SETTING_MENTIONS + default: + panic(fmt.Errorf("invalid reply settings value: %s", settings)) + } +} diff --git a/x/posts/legacy/v3/store_test.go b/x/posts/legacy/v3/store_test.go new file mode 100644 index 0000000000..b058efec02 --- /dev/null +++ b/x/posts/legacy/v3/store_test.go @@ -0,0 +1,125 @@ +package v3_test + +import ( + "testing" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/require" + + v2 "github.com/desmos-labs/desmos/v4/x/posts/legacy/v2" + v3 "github.com/desmos-labs/desmos/v4/x/posts/legacy/v3" + + "github.com/desmos-labs/desmos/v4/app" + "github.com/desmos-labs/desmos/v4/testutil/storetesting" + "github.com/desmos-labs/desmos/v4/x/posts/types" + subspacestypes "github.com/desmos-labs/desmos/v4/x/subspaces/types" +) + +func TestMigrateStore(t *testing.T) { + cdc, _ := app.MakeCodecs() + + // Build all the necessary keys + keys := sdk.NewKVStoreKeys(paramstypes.StoreKey, subspacestypes.StoreKey, types.StoreKey) + tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + + testCases := []struct { + name string + store func(ctx sdk.Context) + shouldErr bool + check func(ctx sdk.Context) + }{ + { + name: "posts are migrated properly", + store: func(ctx sdk.Context) { + post := v2.NewPost( + 1, + 0, + 1, + "External id", + "This is a post text that does not contain any useful information", + "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", + 1, + v2.NewEntities( + []v2.Tag{ + v2.NewTag(1, 3, "tag"), + }, + []v2.Tag{ + v2.NewTag(4, 6, "tag"), + }, + []v2.Url{ + v2.NewURL(7, 9, "URL", "Display URL"), + }, + ), + []v2.PostReference{ + v2.NewPostReference(v2.POST_REFERENCE_TYPE_QUOTE, 1, 0), + }, + v2.REPLY_SETTING_EVERYONE, + time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), + nil, + ) + + store := ctx.KVStore(keys[types.StoreKey]) + store.Set(types.PostStoreKey(1, 1), cdc.MustMarshal(&post)) + }, + shouldErr: false, + check: func(ctx sdk.Context) { + store := ctx.KVStore(keys[types.StoreKey]) + + var stored types.Post + err := cdc.Unmarshal(store.Get(types.PostStoreKey(1, 1)), &stored) + require.NoError(t, err) + require.Equal(t, types.NewPost( + 1, + 0, + 1, + "External id", + "This is a post text that does not contain any useful information", + "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", + 1, + types.NewEntities( + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), + }, + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), + }, + []types.Url{ + types.NewURL(7, 9, "URL", "Display URL"), + }, + ), + nil, + []types.PostReference{ + types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), + }, + types.REPLY_SETTING_EVERYONE, + time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), + nil, + ), stored) + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + ctx := storetesting.BuildContext(keys, tKeys, memKeys) + if tc.store != nil { + tc.store(ctx) + } + + err := v3.MigrateStore(ctx, keys[types.StoreKey], cdc) + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + if tc.check != nil { + tc.check(ctx) + } + } + }) + } +} diff --git a/x/posts/module.go b/x/posts/module.go index 894feae6da..0702359f11 100644 --- a/x/posts/module.go +++ b/x/posts/module.go @@ -30,7 +30,7 @@ import ( ) const ( - consensusVersion = 2 + consensusVersion = 3 ) // type check to ensure the interface is properly implemented @@ -114,6 +114,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err != nil { panic(err) } + err = cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3) + if err != nil { + panic(err) + } } // NewAppModule creates a new AppModule Object diff --git a/x/posts/simulation/decoder_test.go b/x/posts/simulation/decoder_test.go index c1ae8a5414..7e6d0d7f8d 100644 --- a/x/posts/simulation/decoder_test.go +++ b/x/posts/simulation/decoder_test.go @@ -26,16 +26,17 @@ func TestDecodeStore(t *testing.T) { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"general"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, diff --git a/x/posts/simulation/operations_posts.go b/x/posts/simulation/operations_posts.go index 8de6efc1ba..1ad2eeccdf 100644 --- a/x/posts/simulation/operations_posts.go +++ b/x/posts/simulation/operations_posts.go @@ -44,6 +44,7 @@ func SimulateMsgCreatePost( data.ConversationID, data.ReplySettings, data.Entities, + data.Tags, nil, data.ReferencedPosts, author.Address.String(), @@ -124,7 +125,7 @@ func SimulateMsgEditPost( return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "edit post"), nil, nil } - msg := types.NewMsgEditPost(subspaceID, postID, data.Text, data.Entities, editor.Address.String()) + msg := types.NewMsgEditPost(subspaceID, postID, data.Text, data.Entities, data.Tags, editor.Address.String()) err = simtesting.SendMsg(r, app, ak, bk, fk, msg, ctx, chainID, DefaultGasValue, []cryptotypes.PrivKey{editor.PrivKey}) if err != nil { return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "edit post"), nil, err @@ -176,6 +177,7 @@ func randomPostEditFields( update = types.NewPostUpdate( GenerateRandomText(r, k.GetParams(ctx).MaxTextLength), nil, + GenerateRandomTags(r, 4), time.Now(), ) return subspaceID, postID, update, editor, false diff --git a/x/posts/simulation/utils.go b/x/posts/simulation/utils.go index afa9c30d22..d6ef9754ea 100644 --- a/x/posts/simulation/utils.go +++ b/x/posts/simulation/utils.go @@ -38,6 +38,7 @@ func GenerateRandomPost(r *rand.Rand, accounts []simtypes.Account, subspaceID ui author.Address.String(), 0, nil, + GenerateRandomTags(r, 10), nil, RandomReplySettings(r), time.Now(), @@ -50,6 +51,15 @@ func GenerateRandomText(r *rand.Rand, maxLength uint32) string { return simtypes.RandStringOfLength(r, int(maxLength)) } +// GenerateRandomTags returns a slice containing tagsNumber randomly generated tags +func GenerateRandomTags(r *rand.Rand, tagsNumber int) []string { + tags := make([]string, tagsNumber) + for i := 0; i < tagsNumber; i++ { + tags[i] = simtypes.RandStringOfLength(r, 10) + } + return tags +} + // RandomReplySettings returns a random valid ReplySetting for the post func RandomReplySettings(r *rand.Rand) types.ReplySetting { return allowedReplySettings[r.Intn(len(allowedReplySettings))] diff --git a/x/posts/types/genesis.pb.go b/x/posts/types/genesis.pb.go index 3532c2ed0e..07be875226 100644 --- a/x/posts/types/genesis.pb.go +++ b/x/posts/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/posts/v1/genesis.proto +// source: desmos/posts/v2/genesis.proto package types @@ -42,7 +42,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_26b7acf2775f2913, []int{0} + return fileDescriptor_87a37b3ab79ad9ac, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -130,7 +130,7 @@ func (m *SubspaceDataEntry) Reset() { *m = SubspaceDataEntry{} } func (m *SubspaceDataEntry) String() string { return proto.CompactTextString(m) } func (*SubspaceDataEntry) ProtoMessage() {} func (*SubspaceDataEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_26b7acf2775f2913, []int{1} + return fileDescriptor_87a37b3ab79ad9ac, []int{1} } func (m *SubspaceDataEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -184,7 +184,7 @@ func (m *PostDataEntry) Reset() { *m = PostDataEntry{} } func (m *PostDataEntry) String() string { return proto.CompactTextString(m) } func (*PostDataEntry) ProtoMessage() {} func (*PostDataEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_26b7acf2775f2913, []int{2} + return fileDescriptor_87a37b3ab79ad9ac, []int{2} } func (m *PostDataEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -246,7 +246,7 @@ func (m *ActivePollData) Reset() { *m = ActivePollData{} } func (m *ActivePollData) String() string { return proto.CompactTextString(m) } func (*ActivePollData) ProtoMessage() {} func (*ActivePollData) Descriptor() ([]byte, []int) { - return fileDescriptor_26b7acf2775f2913, []int{3} + return fileDescriptor_87a37b3ab79ad9ac, []int{3} } func (m *ActivePollData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -304,54 +304,54 @@ func (m *ActivePollData) GetEndDate() time.Time { } func init() { - proto.RegisterType((*GenesisState)(nil), "desmos.posts.v1.GenesisState") - proto.RegisterType((*SubspaceDataEntry)(nil), "desmos.posts.v1.SubspaceDataEntry") - proto.RegisterType((*PostDataEntry)(nil), "desmos.posts.v1.PostDataEntry") - proto.RegisterType((*ActivePollData)(nil), "desmos.posts.v1.ActivePollData") + proto.RegisterType((*GenesisState)(nil), "desmos.posts.v2.GenesisState") + proto.RegisterType((*SubspaceDataEntry)(nil), "desmos.posts.v2.SubspaceDataEntry") + proto.RegisterType((*PostDataEntry)(nil), "desmos.posts.v2.PostDataEntry") + proto.RegisterType((*ActivePollData)(nil), "desmos.posts.v2.ActivePollData") } -func init() { proto.RegisterFile("desmos/posts/v1/genesis.proto", fileDescriptor_26b7acf2775f2913) } +func init() { proto.RegisterFile("desmos/posts/v2/genesis.proto", fileDescriptor_87a37b3ab79ad9ac) } -var fileDescriptor_26b7acf2775f2913 = []byte{ +var fileDescriptor_87a37b3ab79ad9ac = []byte{ // 600 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xbf, 0x6e, 0xd3, 0x40, - 0x18, 0xcf, 0x35, 0x69, 0x12, 0x2e, 0x7f, 0xaa, 0xba, 0x54, 0xb5, 0x02, 0xd8, 0x51, 0x58, 0xb2, - 0x60, 0x2b, 0x05, 0x06, 0x58, 0x50, 0x53, 0x23, 0x6a, 0x31, 0x50, 0xa5, 0xb0, 0xb0, 0x44, 0x97, + 0x18, 0xcf, 0x35, 0x69, 0x5a, 0x2e, 0x4d, 0xaa, 0x5e, 0xa9, 0x6a, 0x05, 0xb0, 0xa3, 0xb0, 0x64, + 0xc1, 0x16, 0x01, 0x06, 0x58, 0x50, 0x53, 0x23, 0x6a, 0x31, 0x50, 0xa5, 0xb0, 0xb0, 0x44, 0x97, 0xf8, 0x70, 0x2d, 0x9d, 0x7d, 0x96, 0xef, 0x12, 0xe8, 0x23, 0xb0, 0x75, 0x64, 0xec, 0x83, 0xf0, 0x00, 0x1d, 0x3b, 0x21, 0xa6, 0x80, 0x9c, 0x85, 0x85, 0x77, 0x40, 0x3e, 0x9f, 0xf3, 0xcf, 0x30, - 0x30, 0x74, 0xbb, 0xbb, 0xef, 0xf7, 0x2f, 0xf9, 0x3e, 0x7f, 0xf0, 0x81, 0x83, 0x99, 0x4f, 0x99, - 0x19, 0x52, 0xc6, 0x99, 0x39, 0xed, 0x99, 0x2e, 0x0e, 0x30, 0xf3, 0x98, 0x11, 0x46, 0x94, 0x53, - 0x65, 0x27, 0x2d, 0x1b, 0xa2, 0x6c, 0x4c, 0x7b, 0xad, 0xbb, 0x2e, 0x75, 0xa9, 0xa8, 0x99, 0xc9, - 0x29, 0x85, 0xb5, 0x74, 0x97, 0x52, 0x97, 0x60, 0x53, 0xdc, 0x46, 0x93, 0x0f, 0x26, 0xf7, 0x7c, - 0xcc, 0x38, 0xf2, 0x43, 0x09, 0xb8, 0xbf, 0x69, 0xe3, 0x53, 0x07, 0x13, 0xe9, 0xd2, 0xf9, 0x5d, - 0x84, 0xf5, 0x57, 0xa9, 0xef, 0x19, 0x47, 0x1c, 0x2b, 0x6f, 0x60, 0x93, 0x4d, 0x46, 0x2c, 0x44, - 0x63, 0xcc, 0x86, 0x0e, 0xe2, 0x48, 0x05, 0xed, 0x62, 0xb7, 0x76, 0xd8, 0x31, 0x36, 0xf2, 0x18, - 0x67, 0x12, 0x66, 0x21, 0x8e, 0x5e, 0x06, 0x3c, 0xba, 0xe8, 0x97, 0xae, 0x67, 0x7a, 0x61, 0xd0, - 0x58, 0xf0, 0x93, 0x8a, 0x72, 0x0c, 0xa1, 0xa0, 0xa4, 0x62, 0x5b, 0x42, 0x4c, 0xcb, 0x89, 0x9d, - 0x52, 0xc6, 0x37, 0x85, 0xee, 0x88, 0xaa, 0x10, 0xe9, 0xc1, 0x6d, 0x71, 0x51, 0x8b, 0x82, 0xbf, - 0xff, 0x57, 0xbe, 0xa4, 0xa5, 0x48, 0xe5, 0x18, 0xd6, 0x10, 0xe7, 0x68, 0x7c, 0xee, 0xe3, 0x80, - 0x33, 0xb5, 0x24, 0x88, 0xf7, 0x72, 0xc4, 0xa3, 0x05, 0x46, 0xd2, 0x57, 0x59, 0xca, 0x09, 0xac, - 0xa3, 0x31, 0xf7, 0xa6, 0x78, 0x18, 0x52, 0x42, 0x98, 0xba, 0x2d, 0x54, 0xf4, 0xbc, 0x8a, 0x00, - 0x9d, 0x52, 0x42, 0x92, 0xb8, 0x0b, 0xa5, 0xc5, 0x2b, 0x53, 0x2c, 0x58, 0x9f, 0x30, 0x1c, 0x0d, - 0x51, 0xc0, 0x3e, 0xe2, 0x88,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, 0xb8, 0xfc, 0x6e, 0x80, 0xfe, 0x16, 0x09, 0x5d, 0x1b, 0x0b, + 0xb2, 0xf8, 0x61, 0xbd, 0x93, 0xeb, 0x44, 0x07, 0x37, 0x89, 0x0e, 0x7e, 0x24, 0x3a, 0xb8, 0x9c, + 0xe9, 0xa5, 0x9b, 0x99, 0x5e, 0xfa, 0x36, 0xd3, 0x4b, 0xef, 0x4c, 0xcf, 0x17, 0xe7, 0xe3, 0xa1, + 0x39, 0x62, 0x81, 0x95, 0x0d, 0xde, 0x03, 0x8a, 0x87, 0x5c, 0x9d, 0xad, 0xc9, 0x63, 0xeb, 0xa3, + 0xda, 0x33, 0xe2, 0x22, 0x22, 0x7c, 0x58, 0x95, 0xd6, 0x8f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, + 0x70, 0x3b, 0xe4, 0x72, 0xeb, 0x04, 0x00, 0x00, } func (this *GenesisState) Equal(that interface{}) bool { diff --git a/x/posts/types/genesis_test.go b/x/posts/types/genesis_test.go index 96b843622c..a4b010d064 100644 --- a/x/posts/types/genesis_test.go +++ b/x/posts/types/genesis_test.go @@ -47,6 +47,7 @@ func TestValidateGenesis(t *testing.T) { 1, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -77,6 +78,7 @@ func TestValidateGenesis(t *testing.T) { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -91,6 +93,7 @@ func TestValidateGenesis(t *testing.T) { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -136,6 +139,7 @@ func TestValidateGenesis(t *testing.T) { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -175,6 +179,7 @@ func TestValidateGenesis(t *testing.T) { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -245,6 +250,7 @@ func TestValidateGenesis(t *testing.T) { 0, nil, nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/posts/types/models.go b/x/posts/types/models.go index 67f26118f1..f62ba90385 100644 --- a/x/posts/types/models.go +++ b/x/posts/types/models.go @@ -36,6 +36,7 @@ func NewPost( author string, conversationID uint64, entities *Entities, + tags []string, referencedPosts []PostReference, replySetting ReplySetting, creationDate time.Time, @@ -48,6 +49,7 @@ func NewPost( ExternalID: externalID, Text: text, Entities: entities, + Tags: tags, Author: author, ConversationID: conversationID, ReferencedPosts: referencedPosts, @@ -74,6 +76,12 @@ func (p Post) Validate() error { } } + for _, tag := range p.Tags { + if strings.TrimSpace(tag) == "" { + return fmt.Errorf("invalid post tag: %s", tag) + } + } + _, err := sdk.AccAddressFromBech32(p.Author) if err != nil { return fmt.Errorf("invalid author address: %s", err) @@ -177,14 +185,18 @@ type PostUpdate struct { // Update's entities will always replace the existing ones Entities *Entities + // Update's tags will always replace the existing ones + Tags []string + UpdateTime time.Time } // NewPostUpdate returns a new PostUpdate instance -func NewPostUpdate(text string, entities *Entities, updateTime time.Time) PostUpdate { +func NewPostUpdate(text string, entities *Entities, tags []string, updateTime time.Time) PostUpdate { return PostUpdate{ Text: text, Entities: entities, + Tags: tags, UpdateTime: updateTime, } } @@ -206,6 +218,7 @@ func (p Post) Update(update PostUpdate) Post { p.Author, p.ConversationID, update.Entities, + update.Tags, p.ReferencedPosts, p.ReplySettings, p.CreationDate, @@ -216,7 +229,7 @@ func (p Post) Update(update PostUpdate) Post { // -------------------------------------------------------------------------------------------------------------------- // NewEntities returns a new Entities instance -func NewEntities(hashtags []Tag, mentions []Tag, urls []Url) *Entities { +func NewEntities(hashtags []TextTag, mentions []TextTag, urls []Url) *Entities { return &Entities{ Hashtags: hashtags, Mentions: mentions, @@ -311,9 +324,9 @@ func (e *Entities) getSegments() []entitySegment { return segments } -// NewTag returns a new Tag instance -func NewTag(start, end uint64, tag string) Tag { - return Tag{ +// NewTextTag returns a new TextTag instance +func NewTextTag(start, end uint64, tag string) TextTag { + return TextTag{ Start: start, End: end, Tag: tag, @@ -321,7 +334,7 @@ func NewTag(start, end uint64, tag string) Tag { } // Validate implements fmt.Validator -func (t Tag) Validate() error { +func (t TextTag) Validate() error { if t.Start > t.End { return fmt.Errorf("invalid start and end indexes: %d %d", t.Start, t.End) } diff --git a/x/posts/types/models.pb.go b/x/posts/types/models.pb.go index 1c07eb2393..979cb39d66 100644 --- a/x/posts/types/models.pb.go +++ b/x/posts/types/models.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/posts/v1/models.proto +// source: desmos/posts/v2/models.proto package types @@ -62,7 +62,7 @@ func (x PostReferenceType) String() string { } func (PostReferenceType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{0} + return fileDescriptor_e95e095003620aff, []int{0} } // ReplySetting contains the possible reply settings that a post can have @@ -102,7 +102,7 @@ func (x ReplySetting) String() string { } func (ReplySetting) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{1} + return fileDescriptor_e95e095003620aff, []int{1} } // Post contains all the information about a single post @@ -119,25 +119,27 @@ type Post struct { Text string `protobuf:"bytes,5,opt,name=text,proto3" json:"text,omitempty"` // (optional) Entities connected to this post Entities *Entities `protobuf:"bytes,6,opt,name=entities,proto3" json:"entities,omitempty"` + // Tags related to this post, useful for categorization + Tags []string `protobuf:"bytes,7,rep,name=tags,proto3" json:"tags,omitempty"` // Author of the post - Author string `protobuf:"bytes,7,opt,name=author,proto3" json:"author,omitempty"` + Author string `protobuf:"bytes,8,opt,name=author,proto3" json:"author,omitempty"` // (optional) Id of the original post of the conversation - ConversationID uint64 `protobuf:"varint,8,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` + ConversationID uint64 `protobuf:"varint,9,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` // A list this posts references (either as a reply, repost or quote) - ReferencedPosts []PostReference `protobuf:"bytes,9,rep,name=referenced_posts,json=referencedPosts,proto3" json:"referenced_posts"` + ReferencedPosts []PostReference `protobuf:"bytes,10,rep,name=referenced_posts,json=referencedPosts,proto3" json:"referenced_posts"` // Reply settings of this post - ReplySettings ReplySetting `protobuf:"varint,10,opt,name=reply_settings,json=replySettings,proto3,enum=desmos.posts.v1.ReplySetting" json:"reply_settings,omitempty"` + ReplySettings ReplySetting `protobuf:"varint,11,opt,name=reply_settings,json=replySettings,proto3,enum=desmos.posts.v2.ReplySetting" json:"reply_settings,omitempty"` // Creation date of the post - CreationDate time.Time `protobuf:"bytes,11,opt,name=creation_date,json=creationDate,proto3,stdtime" json:"creation_date"` + CreationDate time.Time `protobuf:"bytes,12,opt,name=creation_date,json=creationDate,proto3,stdtime" json:"creation_date"` // (optional) Last edited time of the post - LastEditedDate *time.Time `protobuf:"bytes,12,opt,name=last_edited_date,json=lastEditedDate,proto3,stdtime" json:"last_edited_date,omitempty"` + LastEditedDate *time.Time `protobuf:"bytes,13,opt,name=last_edited_date,json=lastEditedDate,proto3,stdtime" json:"last_edited_date,omitempty"` } func (m *Post) Reset() { *m = Post{} } func (m *Post) String() string { return proto.CompactTextString(m) } func (*Post) ProtoMessage() {} func (*Post) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{0} + return fileDescriptor_e95e095003620aff, []int{0} } func (m *Post) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -208,6 +210,13 @@ func (m *Post) GetEntities() *Entities { return nil } +func (m *Post) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + func (m *Post) GetAuthor() string { if m != nil { return m.Author @@ -253,7 +262,7 @@ func (m *Post) GetLastEditedDate() *time.Time { // PostReference contains the details of a post reference type PostReference struct { // Type of reference - Type PostReferenceType `protobuf:"varint,1,opt,name=type,proto3,enum=desmos.posts.v1.PostReferenceType" json:"type,omitempty"` + Type PostReferenceType `protobuf:"varint,1,opt,name=type,proto3,enum=desmos.posts.v2.PostReferenceType" json:"type,omitempty"` // Id of the referenced post PostID uint64 `protobuf:"varint,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` // Position of the reference inside the post's text. This should be used only @@ -265,7 +274,7 @@ func (m *PostReference) Reset() { *m = PostReference{} } func (m *PostReference) String() string { return proto.CompactTextString(m) } func (*PostReference) ProtoMessage() {} func (*PostReference) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{1} + return fileDescriptor_e95e095003620aff, []int{1} } func (m *PostReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -317,16 +326,19 @@ func (m *PostReference) GetPosition() uint64 { // Contains the details of entities parsed out of the post text type Entities struct { - Hashtags []Tag `protobuf:"bytes,1,rep,name=hashtags,proto3" json:"hashtags"` - Mentions []Tag `protobuf:"bytes,2,rep,name=mentions,proto3" json:"mentions"` - Urls []Url `protobuf:"bytes,3,rep,name=urls,proto3" json:"urls"` + // Hashtags represent inside the post text + Hashtags []TextTag `protobuf:"bytes,1,rep,name=hashtags,proto3" json:"hashtags"` + // Mentions present inside the post text + Mentions []TextTag `protobuf:"bytes,2,rep,name=mentions,proto3" json:"mentions"` + // Links present inside the post text + Urls []Url `protobuf:"bytes,3,rep,name=urls,proto3" json:"urls"` } func (m *Entities) Reset() { *m = Entities{} } func (m *Entities) String() string { return proto.CompactTextString(m) } func (*Entities) ProtoMessage() {} func (*Entities) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{2} + return fileDescriptor_e95e095003620aff, []int{2} } func (m *Entities) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -355,14 +367,14 @@ func (m *Entities) XXX_DiscardUnknown() { var xxx_messageInfo_Entities proto.InternalMessageInfo -func (m *Entities) GetHashtags() []Tag { +func (m *Entities) GetHashtags() []TextTag { if m != nil { return m.Hashtags } return nil } -func (m *Entities) GetMentions() []Tag { +func (m *Entities) GetMentions() []TextTag { if m != nil { return m.Mentions } @@ -376,8 +388,8 @@ func (m *Entities) GetUrls() []Url { return nil } -// Tag represents a generic tag -type Tag struct { +// TextTag represents a tag within the post text +type TextTag struct { // Index of the character inside the text at which the tag starts Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` // Index of the character inside the text at which the tag ends @@ -386,18 +398,18 @@ type Tag struct { Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"` } -func (m *Tag) Reset() { *m = Tag{} } -func (m *Tag) String() string { return proto.CompactTextString(m) } -func (*Tag) ProtoMessage() {} -func (*Tag) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{3} +func (m *TextTag) Reset() { *m = TextTag{} } +func (m *TextTag) String() string { return proto.CompactTextString(m) } +func (*TextTag) ProtoMessage() {} +func (*TextTag) Descriptor() ([]byte, []int) { + return fileDescriptor_e95e095003620aff, []int{3} } -func (m *Tag) XXX_Unmarshal(b []byte) error { +func (m *TextTag) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TextTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Tag.Marshal(b, m, deterministic) + return xxx_messageInfo_TextTag.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -407,33 +419,33 @@ func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Tag) XXX_Merge(src proto.Message) { - xxx_messageInfo_Tag.Merge(m, src) +func (m *TextTag) XXX_Merge(src proto.Message) { + xxx_messageInfo_TextTag.Merge(m, src) } -func (m *Tag) XXX_Size() int { +func (m *TextTag) XXX_Size() int { return m.Size() } -func (m *Tag) XXX_DiscardUnknown() { - xxx_messageInfo_Tag.DiscardUnknown(m) +func (m *TextTag) XXX_DiscardUnknown() { + xxx_messageInfo_TextTag.DiscardUnknown(m) } -var xxx_messageInfo_Tag proto.InternalMessageInfo +var xxx_messageInfo_TextTag proto.InternalMessageInfo -func (m *Tag) GetStart() uint64 { +func (m *TextTag) GetStart() uint64 { if m != nil { return m.Start } return 0 } -func (m *Tag) GetEnd() uint64 { +func (m *TextTag) GetEnd() uint64 { if m != nil { return m.End } return 0 } -func (m *Tag) GetTag() string { +func (m *TextTag) GetTag() string { if m != nil { return m.Tag } @@ -456,7 +468,7 @@ func (m *Url) Reset() { *m = Url{} } func (m *Url) String() string { return proto.CompactTextString(m) } func (*Url) ProtoMessage() {} func (*Url) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{4} + return fileDescriptor_e95e095003620aff, []int{4} } func (m *Url) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -533,7 +545,7 @@ func (m *Attachment) Reset() { *m = Attachment{} } func (m *Attachment) String() string { return proto.CompactTextString(m) } func (*Attachment) ProtoMessage() {} func (*Attachment) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{5} + return fileDescriptor_e95e095003620aff, []int{5} } func (m *Attachment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -607,7 +619,7 @@ func (m *Media) Reset() { *m = Media{} } func (m *Media) String() string { return proto.CompactTextString(m) } func (*Media) ProtoMessage() {} func (*Media) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{6} + return fileDescriptor_e95e095003620aff, []int{6} } func (m *Media) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -670,7 +682,7 @@ func (m *Poll) Reset() { *m = Poll{} } func (m *Poll) String() string { return proto.CompactTextString(m) } func (*Poll) ProtoMessage() {} func (*Poll) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{7} + return fileDescriptor_e95e095003620aff, []int{7} } func (m *Poll) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -753,7 +765,7 @@ func (m *Poll_ProvidedAnswer) Reset() { *m = Poll_ProvidedAnswer{} } func (m *Poll_ProvidedAnswer) String() string { return proto.CompactTextString(m) } func (*Poll_ProvidedAnswer) ProtoMessage() {} func (*Poll_ProvidedAnswer) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{7, 0} + return fileDescriptor_e95e095003620aff, []int{7, 0} } func (m *Poll_ProvidedAnswer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -816,7 +828,7 @@ func (m *UserAnswer) Reset() { *m = UserAnswer{} } func (m *UserAnswer) String() string { return proto.CompactTextString(m) } func (*UserAnswer) ProtoMessage() {} func (*UserAnswer) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{8} + return fileDescriptor_e95e095003620aff, []int{8} } func (m *UserAnswer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -896,7 +908,7 @@ func (m *PollTallyResults) Reset() { *m = PollTallyResults{} } func (m *PollTallyResults) String() string { return proto.CompactTextString(m) } func (*PollTallyResults) ProtoMessage() {} func (*PollTallyResults) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{9} + return fileDescriptor_e95e095003620aff, []int{9} } func (m *PollTallyResults) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -944,7 +956,7 @@ func (m *PollTallyResults_AnswerResult) Reset() { *m = PollTallyResults_ func (m *PollTallyResults_AnswerResult) String() string { return proto.CompactTextString(m) } func (*PollTallyResults_AnswerResult) ProtoMessage() {} func (*PollTallyResults_AnswerResult) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{9, 0} + return fileDescriptor_e95e095003620aff, []int{9, 0} } func (m *PollTallyResults_AnswerResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -997,7 +1009,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_9cb993d391569998, []int{10} + return fileDescriptor_e95e095003620aff, []int{10} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1034,112 +1046,112 @@ func (m *Params) GetMaxTextLength() uint32 { } func init() { - proto.RegisterEnum("desmos.posts.v1.PostReferenceType", PostReferenceType_name, PostReferenceType_value) - proto.RegisterEnum("desmos.posts.v1.ReplySetting", ReplySetting_name, ReplySetting_value) - proto.RegisterType((*Post)(nil), "desmos.posts.v1.Post") - proto.RegisterType((*PostReference)(nil), "desmos.posts.v1.PostReference") - proto.RegisterType((*Entities)(nil), "desmos.posts.v1.Entities") - proto.RegisterType((*Tag)(nil), "desmos.posts.v1.Tag") - proto.RegisterType((*Url)(nil), "desmos.posts.v1.Url") - proto.RegisterType((*Attachment)(nil), "desmos.posts.v1.Attachment") - proto.RegisterType((*Media)(nil), "desmos.posts.v1.Media") - proto.RegisterType((*Poll)(nil), "desmos.posts.v1.Poll") - proto.RegisterType((*Poll_ProvidedAnswer)(nil), "desmos.posts.v1.Poll.ProvidedAnswer") - proto.RegisterType((*UserAnswer)(nil), "desmos.posts.v1.UserAnswer") - proto.RegisterType((*PollTallyResults)(nil), "desmos.posts.v1.PollTallyResults") - proto.RegisterType((*PollTallyResults_AnswerResult)(nil), "desmos.posts.v1.PollTallyResults.AnswerResult") - proto.RegisterType((*Params)(nil), "desmos.posts.v1.Params") -} - -func init() { proto.RegisterFile("desmos/posts/v1/models.proto", fileDescriptor_9cb993d391569998) } - -var fileDescriptor_9cb993d391569998 = []byte{ - // 1348 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x6f, 0xdb, 0xc6, - 0x12, 0x37, 0x2d, 0xd9, 0x96, 0x47, 0x96, 0x2c, 0x6f, 0x9c, 0x44, 0x51, 0x5e, 0x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 0xdb, 0xd0, 0xaa, 0xe9, 0x7a, 0x7e, 0x7a, 0x54, 0x81, 0x4e, 0x64, 0x36, 0x1b, 0x18, - 0x62, 0x88, 0xe9, 0xa2, 0xff, 0x01, 0x30, 0xd2, 0xe3, 0x5e, 0xe0, 0x0b, 0xfc, 0xfc, 0x86, 0x56, - 0xcd, 0xd5, 0x73, 0xd3, 0xa3, 0xca, 0x72, 0x47, 0x59, 0xcd, 0x06, 0x5e, 0x8e, 0x00, 0xa6, 0x8b, - 0xae, 0xc1, 0xbc, 0xe7, 0x16, 0x53, 0x92, 0x75, 0x71, 0x7a, 0x54, 0x99, 0x37, 0x1b, 0x78, 0xde, - 0x73, 0xc5, 0xb6, 0x64, 0xcc, 0x49, 0xe8, 0x3b, 0x54, 0xd0, 0xa4, 0x37, 0xb4, 0xea, 0xb2, 0xda, - 0xd6, 0x88, 0xcc, 0x62, 0xdb, 0x18, 0x62, 0xba, 0x08, 0x41, 0x9a, 0x93, 0x31, 0x2f, 0x2e, 0x08, - 0x24, 0x96, 0xdf, 0xe8, 0x5d, 0xc8, 0x10, 0x9f, 0x7b, 0xdc, 0x23, 0xac, 0xb8, 0xb8, 0xa1, 0x55, - 0xb3, 0x5b, 0x37, 0xf4, 0x53, 0x55, 0xd5, 0x8d, 0x08, 0x80, 0x67, 0x50, 0x74, 0x0d, 0x16, 0x9d, - 0x11, 0x3f, 0x08, 0xc2, 0xe2, 0x92, 0x24, 0x8b, 0x56, 0xe8, 0x3d, 0x58, 0xed, 0x05, 0xfe, 0x21, - 0x09, 0x99, 0x13, 0x1f, 0x2f, 0x23, 0x13, 0x47, 0xd3, 0xa3, 0x4a, 0x7e, 0x27, 0xe1, 0x32, 0x1b, - 0x38, 0x9f, 0x84, 0x9a, 0x2e, 0x6a, 0x41, 0x21, 0x24, 0x4f, 0x49, 0x48, 0xfc, 0x1e, 0x71, 0x6d, - 0xb9, 0x7d, 0x71, 0x79, 0x23, 0x55, 0xcd, 0x6e, 0x95, 0xcf, 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xbe, 0xde, 0x0b, 0x06, 0x35, 0xa5, 0x9f, - 0x7b, 0xd4, 0xd9, 0x67, 0xd1, 0x77, 0xed, 0xf0, 0x9d, 0xda, 0x38, 0xfa, 0xfb, 0x17, 0x43, 0x9c, - 0xed, 0x2f, 0xca, 0x01, 0xf8, 0xff, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x8b, 0xc2, 0x6e, 0x52, - 0x1a, 0x0c, 0x00, 0x00, + proto.RegisterEnum("desmos.posts.v2.PostReferenceType", PostReferenceType_name, PostReferenceType_value) + proto.RegisterEnum("desmos.posts.v2.ReplySetting", ReplySetting_name, ReplySetting_value) + proto.RegisterType((*Post)(nil), "desmos.posts.v2.Post") + proto.RegisterType((*PostReference)(nil), "desmos.posts.v2.PostReference") + proto.RegisterType((*Entities)(nil), "desmos.posts.v2.Entities") + proto.RegisterType((*TextTag)(nil), "desmos.posts.v2.TextTag") + proto.RegisterType((*Url)(nil), "desmos.posts.v2.Url") + proto.RegisterType((*Attachment)(nil), "desmos.posts.v2.Attachment") + proto.RegisterType((*Media)(nil), "desmos.posts.v2.Media") + proto.RegisterType((*Poll)(nil), "desmos.posts.v2.Poll") + proto.RegisterType((*Poll_ProvidedAnswer)(nil), "desmos.posts.v2.Poll.ProvidedAnswer") + proto.RegisterType((*UserAnswer)(nil), "desmos.posts.v2.UserAnswer") + proto.RegisterType((*PollTallyResults)(nil), "desmos.posts.v2.PollTallyResults") + proto.RegisterType((*PollTallyResults_AnswerResult)(nil), "desmos.posts.v2.PollTallyResults.AnswerResult") + proto.RegisterType((*Params)(nil), "desmos.posts.v2.Params") +} + +func init() { proto.RegisterFile("desmos/posts/v2/models.proto", fileDescriptor_e95e095003620aff) } + +var fileDescriptor_e95e095003620aff = []byte{ + // 1360 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0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a, 0x64, 0x43, 0xbb, 0x47, 0x2c, 0xd7, 0xc9, 0x6b, 0x65, + 0xad, 0x92, 0xac, 0x65, 0xa7, 0x27, 0x25, 0x68, 0x87, 0x66, 0xb3, 0x8e, 0x21, 0x82, 0x98, 0x0e, + 0x7a, 0x0b, 0x80, 0x91, 0x1e, 0x77, 0x7d, 0x4f, 0xe0, 0x17, 0xcb, 0x5a, 0x25, 0x53, 0xcb, 0x4c, + 0x4f, 0x4a, 0xab, 0x6d, 0x65, 0x35, 0xeb, 0x78, 0x35, 0x04, 0x98, 0x0e, 0xba, 0x02, 0x8b, 0xae, + 0x93, 0x4f, 0x48, 0xd6, 0xe5, 0xe9, 0x49, 0x69, 0xd1, 0xac, 0xe3, 0x45, 0xd7, 0x11, 0xc7, 0x92, + 0x31, 0x27, 0x81, 0x67, 0x53, 0x41, 0x93, 0x2c, 0x6b, 0x95, 0x55, 0x75, 0xac, 0x11, 0x9a, 0xc5, + 0xb1, 0x11, 0xc4, 0x74, 0x10, 0x82, 0x24, 0x27, 0x63, 0x9e, 0x5f, 0x12, 0x48, 0x2c, 0xd7, 0xe8, + 0x5d, 0x48, 0x11, 0x8f, 0xbb, 0xdc, 0x25, 0x2c, 0xbf, 0x5c, 0xd6, 0x2a, 0xe9, 0xed, 0x6b, 0xfa, + 0xb9, 0xaa, 0xea, 0x46, 0x08, 0xc0, 0x33, 0xa8, 0xa4, 0xb2, 0xfb, 0x2c, 0xbf, 0x52, 0x4e, 0x48, + 0x2a, 0xbb, 0xcf, 0xd0, 0x15, 0x58, 0xb6, 0x47, 0xfc, 0xc8, 0x0f, 0xf2, 0x29, 0x79, 0x40, 0xb8, + 0x43, 0xef, 0xc1, 0x7a, 0xcf, 0xf7, 0x8e, 0x49, 0xc0, 0xec, 0xe8, 0xca, 0xab, 0xf2, 0x32, 0x68, + 0x7a, 0x52, 0xca, 0xee, 0xc5, 0x5c, 0x66, 0x1d, 0x67, 0xe3, 0x50, 0xd3, 0x41, 0x4d, 0xc8, 0x05, + 0xe4, 0x21, 0x09, 0x88, 0xd7, 0x23, 0x8e, 0x25, 0x53, 0xca, 0x43, 0x39, 0x51, 0x49, 0x6f, 0x17, + 0xe7, 0xf2, 0x14, 0xcd, 0xc0, 0x11, 0xb8, 0x96, 0x7c, 0x7a, 0x52, 0x5a, 0xc0, 0xeb, 0xa7, 0xd1, + 0xc2, 0xcd, 0x50, 0x1d, 0xb2, 0x01, 0x19, 0xd2, 0x89, 0xc5, 0x08, 0xe7, 0xae, 0xd7, 0x67, 0xf9, + 0x74, 0x59, 0xab, 0x64, 0xb7, 0x6f, 0xcc, 0xd1, 0x61, 0x01, 0x6b, 0x2b, 0x14, 0xce, 0x04, 0xb1, + 0x1d, 0x43, 0x26, 0x64, 0x7a, 0x01, 0x51, 0xf7, 0x71, 0x6c, 0x4e, 0xf2, 0x6b, 0xb2, 0x76, 0x05, + 0x5d, 0xe9, 0x49, 0x8f, 0xf4, 0xa4, 0x77, 0x22, 0x3d, 0xd5, 0x52, 0x22, 0x9f, 0xc7, 0xbf, 0x95, + 0x34, 0xbc, 0x16, 0x85, 0xd6, 0x6d, 0x4e, 0xd0, 0x47, 0x90, 0xa3, 0x36, 0xe3, 0x16, 0x71, 0x5c, + 0x4e, 0x1c, 0xc5, 0x96, 0x79, 0x29, 0x5b, 0x52, 0x32, 0x65, 0x45, 0xa4, 0x21, 0x03, 0x05, 0xd7, + 0x4e, 0xea, 0xeb, 0x27, 0x25, 0xed, 0x8f, 0x27, 0x25, 0x6d, 0xeb, 0x2b, 0x0d, 0x32, 0x67, 0xea, + 0x81, 0xee, 0x42, 0x92, 0x4f, 0x86, 0x44, 0xca, 0x33, 0xbb, 0xbd, 0xf5, 0xcf, 0xd5, 0xeb, 0x4c, + 0x86, 0x04, 0x4b, 0x3c, 0xba, 0x05, 0x2b, 0x02, 0x13, 0x29, 0x35, 0x59, 0x83, 0xe9, 0x49, 0x69, + 0x59, 0xa0, 0xcd, 0x3a, 0x5e, 0x16, 0x2e, 0x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x45, 0xed, 0xf1, 0xf3, 0xe2, 0xc2, 0xb3, 0xe7, 0xc5, 0x85, 0x5f, 0x9f, 0x17, 0x17, 0x3e, + 0xd5, 0xfb, 0x2e, 0x3f, 0x1a, 0x1d, 0xea, 0x3d, 0x7f, 0x50, 0x55, 0xfa, 0xb9, 0x43, 0xed, 0x43, + 0x16, 0xae, 0xab, 0xc7, 0xef, 0x54, 0xc7, 0xe1, 0xbf, 0x03, 0x31, 0xc4, 0xd9, 0xe1, 0xb2, 0x1c, + 0x80, 0x6f, 0xff, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x10, 0x76, 0x0c, 0x3a, 0x0c, 0x00, 0x00, } func (this *Post) Equal(that interface{}) bool { @@ -1179,6 +1191,14 @@ func (this *Post) Equal(that interface{}) bool { if !this.Entities.Equal(that1.Entities) { return false } + if len(this.Tags) != len(that1.Tags) { + return false + } + for i := range this.Tags { + if this.Tags[i] != that1.Tags[i] { + return false + } + } if this.Author != that1.Author { return false } @@ -1283,14 +1303,14 @@ func (this *Entities) Equal(that interface{}) bool { } return true } -func (this *Tag) Equal(that interface{}) bool { +func (this *TextTag) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*Tag) + that1, ok := that.(*TextTag) if !ok { - that2, ok := that.(Tag) + that2, ok := that.(TextTag) if ok { that1 = &that2 } else { @@ -1637,7 +1657,7 @@ func (m *Post) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n1 i = encodeVarintModels(dAtA, i, uint64(n1)) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x6a } n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationDate):]) if err2 != nil { @@ -1646,11 +1666,11 @@ func (m *Post) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n2 i = encodeVarintModels(dAtA, i, uint64(n2)) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x62 if m.ReplySettings != 0 { i = encodeVarintModels(dAtA, i, uint64(m.ReplySettings)) i-- - dAtA[i] = 0x50 + dAtA[i] = 0x58 } if len(m.ReferencedPosts) > 0 { for iNdEx := len(m.ReferencedPosts) - 1; iNdEx >= 0; iNdEx-- { @@ -1663,20 +1683,29 @@ func (m *Post) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintModels(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x4a + dAtA[i] = 0x52 } } if m.ConversationID != 0 { i = encodeVarintModels(dAtA, i, uint64(m.ConversationID)) i-- - dAtA[i] = 0x40 + dAtA[i] = 0x48 } if len(m.Author) > 0 { i -= len(m.Author) copy(dAtA[i:], m.Author) i = encodeVarintModels(dAtA, i, uint64(len(m.Author))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 + } + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tags[iNdEx]) + copy(dAtA[i:], m.Tags[iNdEx]) + i = encodeVarintModels(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i-- + dAtA[i] = 0x3a + } } if m.Entities != nil { { @@ -1825,7 +1854,7 @@ func (m *Entities) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Tag) Marshal() (dAtA []byte, err error) { +func (m *TextTag) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1835,12 +1864,12 @@ func (m *Tag) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Tag) MarshalTo(dAtA []byte) (int, error) { +func (m *TextTag) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Tag) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TextTag) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2336,6 +2365,12 @@ func (m *Post) Size() (n int) { l = m.Entities.Size() n += 1 + l + sovModels(uint64(l)) } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovModels(uint64(l)) + } + } l = len(m.Author) if l > 0 { n += 1 + l + sovModels(uint64(l)) @@ -2406,7 +2441,7 @@ func (m *Entities) Size() (n int) { return n } -func (m *Tag) Size() (n int) { +func (m *TextTag) Size() (n int) { if m == nil { return 0 } @@ -2807,6 +2842,38 @@ func (m *Post) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Author", wireType) } @@ -2838,7 +2905,7 @@ func (m *Post) Unmarshal(dAtA []byte) error { } m.Author = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ConversationID", wireType) } @@ -2857,7 +2924,7 @@ func (m *Post) Unmarshal(dAtA []byte) error { break } } - case 9: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ReferencedPosts", wireType) } @@ -2891,7 +2958,7 @@ func (m *Post) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: + case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReplySettings", wireType) } @@ -2910,7 +2977,7 @@ func (m *Post) Unmarshal(dAtA []byte) error { break } } - case 11: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) } @@ -2943,7 +3010,7 @@ func (m *Post) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 12: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastEditedDate", wireType) } @@ -3165,7 +3232,7 @@ func (m *Entities) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Hashtags = append(m.Hashtags, Tag{}) + m.Hashtags = append(m.Hashtags, TextTag{}) if err := m.Hashtags[len(m.Hashtags)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3199,7 +3266,7 @@ func (m *Entities) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Mentions = append(m.Mentions, Tag{}) + m.Mentions = append(m.Mentions, TextTag{}) if err := m.Mentions[len(m.Mentions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3259,7 +3326,7 @@ func (m *Entities) Unmarshal(dAtA []byte) error { } return nil } -func (m *Tag) Unmarshal(dAtA []byte) error { +func (m *TextTag) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3282,10 +3349,10 @@ func (m *Tag) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Tag: wiretype end group for non-group") + return fmt.Errorf("proto: TextTag: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Tag: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TextTag: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/posts/types/models_test.go b/x/posts/types/models_test.go index a79beac67d..909829eacf 100644 --- a/x/posts/types/models_test.go +++ b/x/posts/types/models_test.go @@ -26,20 +26,9 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Url{ - types.NewURL(1, 1, "URL", "Display URL"), - }, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -56,20 +45,9 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Url{ - types.NewURL(1, 1, "URL", "Display URL"), - }, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -87,19 +65,37 @@ func TestPost_Validate(t *testing.T) { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, ""), + []types.TextTag{ + types.NewTextTag(1, 1, ""), }, - []types.Tag{ - types.NewTag(1, 1, "tag"), + []types.TextTag{ + types.NewTextTag(1, 1, "tag"), }, []types.Url{ types.NewURL(1, 1, "URL", "Display URL"), }, ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + types.REPLY_SETTING_EVERYONE, + time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), + nil, + ), + shouldErr: true, + }, + { + name: "invalid tag returns error", + post: types.NewPost( + 1, + 0, + 2, + "External id", + "Text", + "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", + 1, + nil, + []string{" "}, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -116,18 +112,9 @@ func TestPost_Validate(t *testing.T) { "Text", "", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(2, 3, "tag"), - }, - nil, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -144,18 +131,9 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(2, 3, "tag"), - }, - nil, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -172,15 +150,8 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(2, 3, "tag"), - }, - nil, - ), + nil, + nil, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 0, 0), }, @@ -200,15 +171,8 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(2, 3, "tag"), - }, - nil, - ), + nil, + nil, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 2, 0), }, @@ -228,16 +192,9 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), - }, - []types.Tag{}, - nil, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_UNSPECIFIED, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -254,18 +211,9 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(2, 3, "tag"), - }, - nil, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Time{}, nil, @@ -282,18 +230,9 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(2, 3, "tag"), - }, - nil, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), &time.Time{}, @@ -310,18 +249,9 @@ func TestPost_Validate(t *testing.T) { "Text", "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, - types.NewEntities( - []types.Tag{ - types.NewTag(1, 1, "tag"), - }, - []types.Tag{ - types.NewTag(2, 3, "tag"), - }, - nil, - ), - []types.PostReference{ - types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), - }, + nil, + nil, + nil, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), &invalidEditDate, @@ -339,16 +269,17 @@ func TestPost_Validate(t *testing.T) { "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg", 1, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"general"}, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), }, @@ -434,8 +365,8 @@ func TestEntities_Validate(t *testing.T) { { name: "invalid hashtag returns error", entities: types.NewEntities( - []types.Tag{ - types.NewTag(0, 0, ""), + []types.TextTag{ + types.NewTextTag(0, 0, ""), }, nil, nil, @@ -446,8 +377,8 @@ func TestEntities_Validate(t *testing.T) { name: "mention returns error", entities: types.NewEntities( nil, - []types.Tag{ - types.NewTag(0, 0, ""), + []types.TextTag{ + types.NewTextTag(0, 0, ""), }, nil, ), @@ -467,9 +398,9 @@ func TestEntities_Validate(t *testing.T) { { name: "overlapping hashtags return error", entities: types.NewEntities( - []types.Tag{ - types.NewTag(1, 5, "First tag"), - types.NewTag(4, 10, "Second tag"), + []types.TextTag{ + types.NewTextTag(1, 5, "First tag"), + types.NewTextTag(4, 10, "Second tag"), }, nil, nil, @@ -480,9 +411,9 @@ func TestEntities_Validate(t *testing.T) { name: "overlapping mentions return error", entities: types.NewEntities( nil, - []types.Tag{ - types.NewTag(1, 5, "First mention"), - types.NewTag(5, 10, "Second mention"), + []types.TextTag{ + types.NewTextTag(1, 5, "First mention"), + types.NewTextTag(5, 10, "Second mention"), }, nil, ), @@ -503,11 +434,11 @@ func TestEntities_Validate(t *testing.T) { { name: "overlapping hashtag and mention return error", entities: types.NewEntities( - []types.Tag{ - types.NewTag(1, 10, "First tag"), + []types.TextTag{ + types.NewTextTag(1, 10, "First tag"), }, - []types.Tag{ - types.NewTag(9, 15, "First mention"), + []types.TextTag{ + types.NewTextTag(9, 15, "First mention"), }, nil, ), @@ -516,8 +447,8 @@ func TestEntities_Validate(t *testing.T) { { name: "overlapping hashtag and url return error", entities: types.NewEntities( - []types.Tag{ - types.NewTag(1, 10, "First tag"), + []types.TextTag{ + types.NewTextTag(1, 10, "First tag"), }, nil, []types.Url{ @@ -530,8 +461,8 @@ func TestEntities_Validate(t *testing.T) { name: "overlapping mention and url return error", entities: types.NewEntities( nil, - []types.Tag{ - types.NewTag(8, 30, "First mention"), + []types.TextTag{ + types.NewTextTag(8, 30, "First mention"), }, []types.Url{ types.NewURL(1, 15, "first url", "First URL"), @@ -542,11 +473,11 @@ func TestEntities_Validate(t *testing.T) { { name: "valid entities returns no error", entities: types.NewEntities( - []types.Tag{ - types.NewTag(1, 2, "first_tag"), + []types.TextTag{ + types.NewTextTag(1, 2, "first_tag"), }, - []types.Tag{ - types.NewTag(3, 4, "first_mention"), + []types.TextTag{ + types.NewTextTag(3, 4, "first_mention"), }, []types.Url{ types.NewURL(5, 6, "url", "Display URL"), @@ -573,22 +504,22 @@ func TestEntities_Validate(t *testing.T) { func TestTag_Validate(t *testing.T) { testCases := []struct { name string - tag types.Tag + tag types.TextTag shouldErr bool }{ { name: "invalid start and end values return error", - tag: types.NewTag(1, 0, "My tag"), + tag: types.NewTextTag(1, 0, "My tag"), shouldErr: true, }, { name: "invalid tag value returns error", - tag: types.NewTag(1, 10, " "), + tag: types.NewTextTag(1, 10, " "), shouldErr: true, }, { name: "valid tag returns no error", - tag: types.NewTag(1, 10, "My tag"), + tag: types.NewTextTag(1, 10, "My tag"), shouldErr: false, }, } diff --git a/x/posts/types/msgs.go b/x/posts/types/msgs.go index 454fc3f1fd..24ed9aa8e5 100644 --- a/x/posts/types/msgs.go +++ b/x/posts/types/msgs.go @@ -2,6 +2,7 @@ package types import ( "fmt" + "strings" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -27,6 +28,7 @@ func NewMsgCreatePost( conversationID uint64, replySettings ReplySetting, entities *Entities, + tags []string, attachments []AttachmentContent, referencedPosts []PostReference, author string, @@ -46,6 +48,7 @@ func NewMsgCreatePost( ExternalID: externalID, Text: text, Entities: entities, + Tags: tags, Attachments: attachmentsAnis, Author: author, ConversationID: conversationID, @@ -82,6 +85,12 @@ func (msg MsgCreatePost) ValidateBasic() error { } } + for _, tag := range msg.Tags { + if strings.TrimSpace(tag) == "" { + return fmt.Errorf("invalid tag: %s", tag) + } + } + for _, attachment := range msg.Attachments { err = attachment.GetCachedValue().(AttachmentContent).Validate() if err != nil { @@ -131,6 +140,7 @@ func NewMsgEditPost( postID uint64, text string, entities *Entities, + tags []string, editor string, ) *MsgEditPost { return &MsgEditPost{ @@ -138,6 +148,7 @@ func NewMsgEditPost( PostID: postID, Text: text, Entities: entities, + Tags: tags, Editor: editor, } } @@ -165,6 +176,12 @@ func (msg MsgEditPost) ValidateBasic() error { } } + for _, tag := range msg.Tags { + if strings.TrimSpace(tag) == "" { + return fmt.Errorf("invalid tag: %s", tag) + } + } + _, err := sdk.AccAddressFromBech32(msg.Editor) if err != nil { return fmt.Errorf("invalid editor address: %s", err) diff --git a/x/posts/types/msgs.pb.go b/x/posts/types/msgs.pb.go index bf30bdc8fb..dddc83f57e 100644 --- a/x/posts/types/msgs.pb.go +++ b/x/posts/types/msgs.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/posts/v1/msgs.proto +// source: desmos/posts/v2/msgs.proto package types @@ -46,23 +46,25 @@ type MsgCreatePost struct { Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` // (optional) Entities connected to this post Entities *Entities `protobuf:"bytes,5,opt,name=entities,proto3" json:"entities,omitempty"` + // Tags connected to this post + Tags []string `protobuf:"bytes,6,rep,name=tags,proto3" json:"tags,omitempty"` // Attachments of the post - Attachments []*types.Any `protobuf:"bytes,6,rep,name=attachments,proto3" json:"attachments,omitempty"` + Attachments []*types.Any `protobuf:"bytes,7,rep,name=attachments,proto3" json:"attachments,omitempty"` // Author of the post - Author string `protobuf:"bytes,7,opt,name=author,proto3" json:"author,omitempty"` + Author string `protobuf:"bytes,8,opt,name=author,proto3" json:"author,omitempty"` // (optional) Id of the original post of the conversation - ConversationID uint64 `protobuf:"varint,8,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` + ConversationID uint64 `protobuf:"varint,9,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` // Reply settings of this post - ReplySettings ReplySetting `protobuf:"varint,9,opt,name=reply_settings,json=replySettings,proto3,enum=desmos.posts.v1.ReplySetting" json:"reply_settings,omitempty"` + ReplySettings ReplySetting `protobuf:"varint,10,opt,name=reply_settings,json=replySettings,proto3,enum=desmos.posts.v2.ReplySetting" json:"reply_settings,omitempty"` // A list this posts references (either as a reply, repost or quote) - ReferencedPosts []PostReference `protobuf:"bytes,10,rep,name=referenced_posts,json=referencedPosts,proto3" json:"referenced_posts"` + ReferencedPosts []PostReference `protobuf:"bytes,11,rep,name=referenced_posts,json=referencedPosts,proto3" json:"referenced_posts"` } func (m *MsgCreatePost) Reset() { *m = MsgCreatePost{} } func (m *MsgCreatePost) String() string { return proto.CompactTextString(m) } func (*MsgCreatePost) ProtoMessage() {} func (*MsgCreatePost) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{0} + return fileDescriptor_2969f58e94d4489d, []int{0} } func (m *MsgCreatePost) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -126,6 +128,13 @@ func (m *MsgCreatePost) GetEntities() *Entities { return nil } +func (m *MsgCreatePost) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + func (m *MsgCreatePost) GetAttachments() []*types.Any { if m != nil { return m.Attachments @@ -173,7 +182,7 @@ func (m *MsgCreatePostResponse) Reset() { *m = MsgCreatePostResponse{} } func (m *MsgCreatePostResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreatePostResponse) ProtoMessage() {} func (*MsgCreatePostResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{1} + return fileDescriptor_2969f58e94d4489d, []int{1} } func (m *MsgCreatePostResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -228,15 +237,18 @@ type MsgEditPost struct { // New entities connected to this post. These will always replace the current // post's entities Entities *Entities `protobuf:"bytes,4,opt,name=entities,proto3" json:"entities,omitempty"` + // New tags connected to this post. These will always replace the current + // post's tags + Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` // Editor of the post - Editor string `protobuf:"bytes,5,opt,name=editor,proto3" json:"editor,omitempty"` + Editor string `protobuf:"bytes,6,opt,name=editor,proto3" json:"editor,omitempty"` } func (m *MsgEditPost) Reset() { *m = MsgEditPost{} } func (m *MsgEditPost) String() string { return proto.CompactTextString(m) } func (*MsgEditPost) ProtoMessage() {} func (*MsgEditPost) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{2} + return fileDescriptor_2969f58e94d4489d, []int{2} } func (m *MsgEditPost) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -293,6 +305,13 @@ func (m *MsgEditPost) GetEntities() *Entities { return nil } +func (m *MsgEditPost) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + func (m *MsgEditPost) GetEditor() string { if m != nil { return m.Editor @@ -310,7 +329,7 @@ func (m *MsgEditPostResponse) Reset() { *m = MsgEditPostResponse{} } func (m *MsgEditPostResponse) String() string { return proto.CompactTextString(m) } func (*MsgEditPostResponse) ProtoMessage() {} func (*MsgEditPostResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{3} + return fileDescriptor_2969f58e94d4489d, []int{3} } func (m *MsgEditPostResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,7 +379,7 @@ func (m *MsgDeletePost) Reset() { *m = MsgDeletePost{} } func (m *MsgDeletePost) String() string { return proto.CompactTextString(m) } func (*MsgDeletePost) ProtoMessage() {} func (*MsgDeletePost) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{4} + return fileDescriptor_2969f58e94d4489d, []int{4} } func (m *MsgDeletePost) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -418,7 +437,7 @@ func (m *MsgDeletePostResponse) Reset() { *m = MsgDeletePostResponse{} } func (m *MsgDeletePostResponse) String() string { return proto.CompactTextString(m) } func (*MsgDeletePostResponse) ProtoMessage() {} func (*MsgDeletePostResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{5} + return fileDescriptor_2969f58e94d4489d, []int{5} } func (m *MsgDeletePostResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +483,7 @@ func (m *MsgAddPostAttachment) Reset() { *m = MsgAddPostAttachment{} } func (m *MsgAddPostAttachment) String() string { return proto.CompactTextString(m) } func (*MsgAddPostAttachment) ProtoMessage() {} func (*MsgAddPostAttachment) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{6} + return fileDescriptor_2969f58e94d4489d, []int{6} } func (m *MsgAddPostAttachment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -533,7 +552,7 @@ func (m *MsgAddPostAttachmentResponse) Reset() { *m = MsgAddPostAttachme func (m *MsgAddPostAttachmentResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddPostAttachmentResponse) ProtoMessage() {} func (*MsgAddPostAttachmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{7} + return fileDescriptor_2969f58e94d4489d, []int{7} } func (m *MsgAddPostAttachmentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -593,7 +612,7 @@ func (m *MsgRemovePostAttachment) Reset() { *m = MsgRemovePostAttachment func (m *MsgRemovePostAttachment) String() string { return proto.CompactTextString(m) } func (*MsgRemovePostAttachment) ProtoMessage() {} func (*MsgRemovePostAttachment) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{8} + return fileDescriptor_2969f58e94d4489d, []int{8} } func (m *MsgRemovePostAttachment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -661,7 +680,7 @@ func (m *MsgRemovePostAttachmentResponse) Reset() { *m = MsgRemovePostAt func (m *MsgRemovePostAttachmentResponse) String() string { return proto.CompactTextString(m) } func (*MsgRemovePostAttachmentResponse) ProtoMessage() {} func (*MsgRemovePostAttachmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{9} + return fileDescriptor_2969f58e94d4489d, []int{9} } func (m *MsgRemovePostAttachmentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -715,7 +734,7 @@ func (m *MsgAnswerPoll) Reset() { *m = MsgAnswerPoll{} } func (m *MsgAnswerPoll) String() string { return proto.CompactTextString(m) } func (*MsgAnswerPoll) ProtoMessage() {} func (*MsgAnswerPoll) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{10} + return fileDescriptor_2969f58e94d4489d, []int{10} } func (m *MsgAnswerPoll) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -787,7 +806,7 @@ func (m *MsgAnswerPollResponse) Reset() { *m = MsgAnswerPollResponse{} } func (m *MsgAnswerPollResponse) String() string { return proto.CompactTextString(m) } func (*MsgAnswerPollResponse) ProtoMessage() {} func (*MsgAnswerPollResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9b1165b51f80014, []int{11} + return fileDescriptor_2969f58e94d4489d, []int{11} } func (m *MsgAnswerPollResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -817,83 +836,84 @@ func (m *MsgAnswerPollResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAnswerPollResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgCreatePost)(nil), "desmos.posts.v1.MsgCreatePost") - proto.RegisterType((*MsgCreatePostResponse)(nil), "desmos.posts.v1.MsgCreatePostResponse") - proto.RegisterType((*MsgEditPost)(nil), "desmos.posts.v1.MsgEditPost") - proto.RegisterType((*MsgEditPostResponse)(nil), "desmos.posts.v1.MsgEditPostResponse") - proto.RegisterType((*MsgDeletePost)(nil), "desmos.posts.v1.MsgDeletePost") - proto.RegisterType((*MsgDeletePostResponse)(nil), "desmos.posts.v1.MsgDeletePostResponse") - proto.RegisterType((*MsgAddPostAttachment)(nil), "desmos.posts.v1.MsgAddPostAttachment") - proto.RegisterType((*MsgAddPostAttachmentResponse)(nil), "desmos.posts.v1.MsgAddPostAttachmentResponse") - proto.RegisterType((*MsgRemovePostAttachment)(nil), "desmos.posts.v1.MsgRemovePostAttachment") - proto.RegisterType((*MsgRemovePostAttachmentResponse)(nil), "desmos.posts.v1.MsgRemovePostAttachmentResponse") - proto.RegisterType((*MsgAnswerPoll)(nil), "desmos.posts.v1.MsgAnswerPoll") - proto.RegisterType((*MsgAnswerPollResponse)(nil), "desmos.posts.v1.MsgAnswerPollResponse") -} - -func init() { proto.RegisterFile("desmos/posts/v1/msgs.proto", fileDescriptor_d9b1165b51f80014) } - -var fileDescriptor_d9b1165b51f80014 = []byte{ - // 944 bytes of a gzipped FileDescriptorProto + proto.RegisterType((*MsgCreatePost)(nil), "desmos.posts.v2.MsgCreatePost") + proto.RegisterType((*MsgCreatePostResponse)(nil), "desmos.posts.v2.MsgCreatePostResponse") + proto.RegisterType((*MsgEditPost)(nil), "desmos.posts.v2.MsgEditPost") + proto.RegisterType((*MsgEditPostResponse)(nil), "desmos.posts.v2.MsgEditPostResponse") + proto.RegisterType((*MsgDeletePost)(nil), "desmos.posts.v2.MsgDeletePost") + proto.RegisterType((*MsgDeletePostResponse)(nil), "desmos.posts.v2.MsgDeletePostResponse") + proto.RegisterType((*MsgAddPostAttachment)(nil), "desmos.posts.v2.MsgAddPostAttachment") + proto.RegisterType((*MsgAddPostAttachmentResponse)(nil), "desmos.posts.v2.MsgAddPostAttachmentResponse") + proto.RegisterType((*MsgRemovePostAttachment)(nil), "desmos.posts.v2.MsgRemovePostAttachment") + proto.RegisterType((*MsgRemovePostAttachmentResponse)(nil), "desmos.posts.v2.MsgRemovePostAttachmentResponse") + proto.RegisterType((*MsgAnswerPoll)(nil), "desmos.posts.v2.MsgAnswerPoll") + proto.RegisterType((*MsgAnswerPollResponse)(nil), "desmos.posts.v2.MsgAnswerPollResponse") +} + +func init() { proto.RegisterFile("desmos/posts/v2/msgs.proto", fileDescriptor_2969f58e94d4489d) } + +var fileDescriptor_2969f58e94d4489d = []byte{ + // 957 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xbf, 0x6f, 0xdb, 0x46, - 0x14, 0x36, 0x2d, 0x45, 0x96, 0x9e, 0x2c, 0x39, 0x61, 0x1d, 0x47, 0x11, 0x5c, 0x51, 0x50, 0x7f, - 0x69, 0xa8, 0xc9, 0x46, 0x6d, 0xa6, 0x4e, 0x92, 0x65, 0xa0, 0x1c, 0xd4, 0x06, 0xb4, 0x87, 0xa2, + 0x14, 0x36, 0x2d, 0x59, 0x96, 0x9e, 0x2c, 0x39, 0x61, 0x1d, 0x87, 0x11, 0x5c, 0x51, 0x50, 0x7f, + 0x69, 0xa8, 0xc9, 0x42, 0x6d, 0xa6, 0x4e, 0x92, 0x65, 0xa0, 0x1c, 0xd4, 0x06, 0xb4, 0x87, 0xa2, 0x8b, 0x40, 0x91, 0x2f, 0x34, 0x01, 0x8a, 0x27, 0xf0, 0xce, 0xaa, 0x3d, 0x74, 0xee, 0x9a, 0xb1, - 0xff, 0x40, 0xff, 0x83, 0xa2, 0x63, 0xc7, 0x22, 0x68, 0x96, 0x8c, 0x9d, 0xd4, 0x42, 0xfe, 0x47, - 0x8a, 0x3b, 0x92, 0x22, 0x1d, 0x52, 0x81, 0x62, 0xd4, 0xd9, 0x78, 0xf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 0x6e, 0x45, 0x81, 0xef, - 0x38, 0xea, 0x71, 0x6c, 0xea, 0xfc, 0x8a, 0x37, 0xce, 0xef, 0x17, 0x09, 0x0e, 0xf3, 0xba, 0x59, - 0x9d, 0xe4, 0x53, 0xa8, 0x25, 0xd7, 0x45, 0xdc, 0x57, 0x6d, 0x70, 0x7f, 0xb9, 0x50, 0x76, 0x13, - 0xba, 0x3e, 0x34, 0x76, 0x13, 0x9a, 0x6e, 0xdf, 0x34, 0xc0, 0xf6, 0xad, 0x0c, 0xf0, 0x87, 0x04, - 0x8f, 0x46, 0xd4, 0x31, 0x70, 0x4a, 0xe6, 0xf8, 0x5e, 0xb4, 0xce, 0xf4, 0x5a, 0xd8, 0xa8, 0xd7, - 0x75, 0xda, 0xda, 0xa0, 0xac, 0xa9, 0xff, 0xff, 0x9c, 0x93, 0x57, 0x92, 0x18, 0x94, 0xbe, 0x4f, - 0x7f, 0xc4, 0xe0, 0x19, 0xf1, 0xbc, 0x3b, 0x12, 0x47, 0x90, 0x3c, 0x2f, 0x91, 0x25, 0x22, 0x79, - 0x5e, 0x48, 0xf2, 0xf8, 0x77, 0xee, 0x33, 0xd8, 0x33, 0x45, 0x21, 0x74, 0xec, 0xfa, 0x36, 0x5e, - 0x8a, 0x4b, 0xa6, 0xd0, 0xad, 0x19, 0xf5, 0x68, 0x5b, 0x0f, 0x77, 0x53, 0x63, 0x77, 0x2f, 0x67, - 0xec, 0x92, 0x66, 0x62, 0xa5, 0x7a, 0xbf, 0x17, 0xa1, 0x30, 0xa2, 0x8e, 0x7c, 0x06, 0x90, 0xfa, - 0xce, 0x67, 0x3f, 0x04, 0x37, 0xee, 0xf7, 0xe6, 0xa7, 0x6f, 0xc7, 0x57, 0xe7, 0xf0, 0x2d, 0x94, - 0x57, 0x77, 0xf1, 0x61, 0x5e, 0x4c, 0x8c, 0x36, 0x3f, 0x7e, 0x1b, 0xba, 0xca, 0x77, 0x06, 0x90, - 0xba, 0xb9, 0x72, 0xab, 0x4c,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0x45, 0x5b, 0xbf, 0x2a, 0x84, 0xbd, 0xc2, 0xc1, 0xeb, 0x15, 0xa5, + 0x29, 0x62, 0xb6, 0xbe, 0xb8, 0x2d, 0x33, 0x2b, 0x5a, 0xc6, 0xc5, 0x85, 0xa2, 0xa5, 0x78, 0xb1, + 0x68, 0x79, 0xe3, 0x0c, 0xbf, 0x79, 0xb9, 0x6a, 0x4b, 0xaf, 0x57, 0x6d, 0xe9, 0xdf, 0x55, 0x5b, + 0x7a, 0x71, 0xd5, 0xde, 0x78, 0x7d, 0xd5, 0xde, 0xf8, 0xeb, 0xaa, 0xbd, 0xf1, 0x83, 0xe6, 0x7a, + 0xec, 0xec, 0x7c, 0xaa, 0xd9, 0x64, 0xa6, 0x47, 0xb9, 0x0e, 0x7d, 0x6b, 0x4a, 0xe3, 0x67, 0x7d, + 0xf1, 0x95, 0x7e, 0x11, 0xff, 0x98, 0xb2, 0xcb, 0x39, 0xd2, 0x69, 0x45, 0x4c, 0xe4, 0x97, 0xff, + 0x05, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x29, 0x67, 0xce, 0x4f, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -932,7 +952,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) CreatePost(ctx context.Context, in *MsgCreatePost, opts ...grpc.CallOption) (*MsgCreatePostResponse, error) { out := new(MsgCreatePostResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Msg/CreatePost", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Msg/CreatePost", in, out, opts...) if err != nil { return nil, err } @@ -941,7 +961,7 @@ func (c *msgClient) CreatePost(ctx context.Context, in *MsgCreatePost, opts ...g func (c *msgClient) EditPost(ctx context.Context, in *MsgEditPost, opts ...grpc.CallOption) (*MsgEditPostResponse, error) { out := new(MsgEditPostResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Msg/EditPost", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Msg/EditPost", in, out, opts...) if err != nil { return nil, err } @@ -950,7 +970,7 @@ func (c *msgClient) EditPost(ctx context.Context, in *MsgEditPost, opts ...grpc. func (c *msgClient) DeletePost(ctx context.Context, in *MsgDeletePost, opts ...grpc.CallOption) (*MsgDeletePostResponse, error) { out := new(MsgDeletePostResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Msg/DeletePost", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Msg/DeletePost", in, out, opts...) if err != nil { return nil, err } @@ -959,7 +979,7 @@ func (c *msgClient) DeletePost(ctx context.Context, in *MsgDeletePost, opts ...g func (c *msgClient) AddPostAttachment(ctx context.Context, in *MsgAddPostAttachment, opts ...grpc.CallOption) (*MsgAddPostAttachmentResponse, error) { out := new(MsgAddPostAttachmentResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Msg/AddPostAttachment", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Msg/AddPostAttachment", in, out, opts...) if err != nil { return nil, err } @@ -968,7 +988,7 @@ func (c *msgClient) AddPostAttachment(ctx context.Context, in *MsgAddPostAttachm func (c *msgClient) RemovePostAttachment(ctx context.Context, in *MsgRemovePostAttachment, opts ...grpc.CallOption) (*MsgRemovePostAttachmentResponse, error) { out := new(MsgRemovePostAttachmentResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Msg/RemovePostAttachment", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Msg/RemovePostAttachment", in, out, opts...) if err != nil { return nil, err } @@ -977,7 +997,7 @@ func (c *msgClient) RemovePostAttachment(ctx context.Context, in *MsgRemovePostA func (c *msgClient) AnswerPoll(ctx context.Context, in *MsgAnswerPoll, opts ...grpc.CallOption) (*MsgAnswerPollResponse, error) { out := new(MsgAnswerPollResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Msg/AnswerPoll", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Msg/AnswerPoll", in, out, opts...) if err != nil { return nil, err } @@ -1037,7 +1057,7 @@ func _Msg_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Msg/CreatePost", + FullMethod: "/desmos.posts.v2.Msg/CreatePost", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CreatePost(ctx, req.(*MsgCreatePost)) @@ -1055,7 +1075,7 @@ func _Msg_EditPost_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Msg/EditPost", + FullMethod: "/desmos.posts.v2.Msg/EditPost", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).EditPost(ctx, req.(*MsgEditPost)) @@ -1073,7 +1093,7 @@ func _Msg_DeletePost_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Msg/DeletePost", + FullMethod: "/desmos.posts.v2.Msg/DeletePost", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).DeletePost(ctx, req.(*MsgDeletePost)) @@ -1091,7 +1111,7 @@ func _Msg_AddPostAttachment_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Msg/AddPostAttachment", + FullMethod: "/desmos.posts.v2.Msg/AddPostAttachment", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).AddPostAttachment(ctx, req.(*MsgAddPostAttachment)) @@ -1109,7 +1129,7 @@ func _Msg_RemovePostAttachment_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Msg/RemovePostAttachment", + FullMethod: "/desmos.posts.v2.Msg/RemovePostAttachment", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).RemovePostAttachment(ctx, req.(*MsgRemovePostAttachment)) @@ -1127,7 +1147,7 @@ func _Msg_AnswerPoll_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Msg/AnswerPoll", + FullMethod: "/desmos.posts.v2.Msg/AnswerPoll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).AnswerPoll(ctx, req.(*MsgAnswerPoll)) @@ -1136,7 +1156,7 @@ func _Msg_AnswerPoll_Handler(srv interface{}, ctx context.Context, dec func(inte } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "desmos.posts.v1.Msg", + ServiceName: "desmos.posts.v2.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1165,7 +1185,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "desmos/posts/v1/msgs.proto", + Metadata: "desmos/posts/v2/msgs.proto", } func (m *MsgCreatePost) Marshal() (dAtA []byte, err error) { @@ -1199,25 +1219,25 @@ func (m *MsgCreatePost) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintMsgs(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x52 + dAtA[i] = 0x5a } } if m.ReplySettings != 0 { i = encodeVarintMsgs(dAtA, i, uint64(m.ReplySettings)) i-- - dAtA[i] = 0x48 + dAtA[i] = 0x50 } if m.ConversationID != 0 { i = encodeVarintMsgs(dAtA, i, uint64(m.ConversationID)) i-- - dAtA[i] = 0x40 + dAtA[i] = 0x48 } if len(m.Author) > 0 { i -= len(m.Author) copy(dAtA[i:], m.Author) i = encodeVarintMsgs(dAtA, i, uint64(len(m.Author))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 } if len(m.Attachments) > 0 { for iNdEx := len(m.Attachments) - 1; iNdEx >= 0; iNdEx-- { @@ -1230,6 +1250,15 @@ func (m *MsgCreatePost) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintMsgs(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x3a + } + } + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tags[iNdEx]) + copy(dAtA[i:], m.Tags[iNdEx]) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i-- dAtA[i] = 0x32 } } @@ -1333,7 +1362,16 @@ func (m *MsgEditPost) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Editor) i = encodeVarintMsgs(dAtA, i, uint64(len(m.Editor))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 + } + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tags[iNdEx]) + copy(dAtA[i:], m.Tags[iNdEx]) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } if m.Entities != nil { { @@ -1746,6 +1784,12 @@ func (m *MsgCreatePost) Size() (n int) { l = m.Entities.Size() n += 1 + l + sovMsgs(uint64(l)) } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovMsgs(uint64(l)) + } + } if len(m.Attachments) > 0 { for _, e := range m.Attachments { l = e.Size() @@ -1805,6 +1849,12 @@ func (m *MsgEditPost) Size() (n int) { l = m.Entities.Size() n += 1 + l + sovMsgs(uint64(l)) } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovMsgs(uint64(l)) + } + } l = len(m.Editor) if l > 0 { n += 1 + l + sovMsgs(uint64(l)) @@ -2133,6 +2183,38 @@ func (m *MsgCreatePost) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Attachments", wireType) } @@ -2166,7 +2248,7 @@ func (m *MsgCreatePost) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Author", wireType) } @@ -2198,7 +2280,7 @@ func (m *MsgCreatePost) Unmarshal(dAtA []byte) error { } m.Author = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ConversationID", wireType) } @@ -2217,7 +2299,7 @@ func (m *MsgCreatePost) Unmarshal(dAtA []byte) error { break } } - case 9: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReplySettings", wireType) } @@ -2236,7 +2318,7 @@ func (m *MsgCreatePost) Unmarshal(dAtA []byte) error { break } } - case 10: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ReferencedPosts", wireType) } @@ -2529,6 +2611,38 @@ func (m *MsgEditPost) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Editor", wireType) } diff --git a/x/posts/types/msgs_test.go b/x/posts/types/msgs_test.go index ee6016a1f7..29e22fcec7 100644 --- a/x/posts/types/msgs_test.go +++ b/x/posts/types/msgs_test.go @@ -36,16 +36,17 @@ var msgCreatePost = types.NewMsgCreatePost( 1, types.REPLY_SETTING_EVERYONE, types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"general"}, attachments, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), @@ -77,6 +78,7 @@ func TestMsgCreatePost_ValidateBasic(t *testing.T) { msgCreatePost.ConversationID, msgCreatePost.ReplySettings, msgCreatePost.Entities, + msgCreatePost.Tags, attachments, msgCreatePost.ReferencedPosts, msgCreatePost.Author, @@ -93,6 +95,7 @@ func TestMsgCreatePost_ValidateBasic(t *testing.T) { msgCreatePost.ConversationID, types.REPLY_SETTING_UNSPECIFIED, msgCreatePost.Entities, + msgCreatePost.Tags, attachments, msgCreatePost.ReferencedPosts, msgCreatePost.Author, @@ -108,10 +111,28 @@ func TestMsgCreatePost_ValidateBasic(t *testing.T) { msgCreatePost.Text, msgCreatePost.ConversationID, msgCreatePost.ReplySettings, - types.NewEntities([]types.Tag{ - types.NewTag(1, 1, "My tag"), - types.NewTag(1, 1, "My tag"), + types.NewEntities([]types.TextTag{ + types.NewTextTag(1, 1, "My tag"), + types.NewTextTag(1, 1, "My tag"), }, nil, nil), + msgCreatePost.Tags, + attachments, + msgCreatePost.ReferencedPosts, + msgCreatePost.Author, + ), + shouldErr: true, + }, + { + name: "invalid tags return error", + msg: types.NewMsgCreatePost( + msgCreatePost.SubspaceID, + msgCreatePost.SectionID, + msgCreatePost.ExternalID, + msgCreatePost.Text, + msgCreatePost.ConversationID, + msgCreatePost.ReplySettings, + msgCreatePost.Entities, + []string{" "}, attachments, msgCreatePost.ReferencedPosts, msgCreatePost.Author, @@ -128,6 +149,7 @@ func TestMsgCreatePost_ValidateBasic(t *testing.T) { msgCreatePost.ConversationID, msgCreatePost.ReplySettings, msgCreatePost.Entities, + msgCreatePost.Tags, []types.AttachmentContent{ types.NewMedia("", ""), }, @@ -146,6 +168,7 @@ func TestMsgCreatePost_ValidateBasic(t *testing.T) { msgCreatePost.ConversationID, msgCreatePost.ReplySettings, msgCreatePost.Entities, + msgCreatePost.Tags, attachments, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_UNSPECIFIED, 0, 1), @@ -164,6 +187,7 @@ func TestMsgCreatePost_ValidateBasic(t *testing.T) { msgCreatePost.ConversationID, msgCreatePost.ReplySettings, msgCreatePost.Entities, + msgCreatePost.Tags, attachments, msgCreatePost.ReferencedPosts, "", @@ -190,7 +214,7 @@ func TestMsgCreatePost_ValidateBasic(t *testing.T) { } func TestMsgCreatePost_GetSignBytes(t *testing.T) { - expected := `{"type":"desmos/MsgCreatePost","value":{"attachments":[{"type":"desmos/Media","value":{"mime_type":"image/png","uri":"ftp://user:password@example.com/image.png"}},{"type":"desmos/Poll","value":{"end_date":"2020-01-01T12:00:00Z","provided_answers":[{"attachments":null,"text":"Cat"},{"attachments":null,"text":"Dog"}],"question":"What animal is best?"}}],"author":"cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd","conversation_id":"1","entities":{"hashtags":[{"end":"3","start":"1","tag":"tag"}],"mentions":[{"end":"6","start":"4","tag":"tag"}],"urls":[{"display_url":"Display URL","end":"9","start":"7","url":"URL"}]},"external_id":"External ID","referenced_posts":[{"post_id":"1","type":2}],"reply_settings":1,"section_id":1,"subspace_id":"1","text":"This is a text"}}` + expected := `{"type":"desmos/MsgCreatePost","value":{"attachments":[{"type":"desmos/Media","value":{"mime_type":"image/png","uri":"ftp://user:password@example.com/image.png"}},{"type":"desmos/Poll","value":{"end_date":"2020-01-01T12:00:00Z","provided_answers":[{"attachments":null,"text":"Cat"},{"attachments":null,"text":"Dog"}],"question":"What animal is best?"}}],"author":"cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd","conversation_id":"1","entities":{"hashtags":[{"end":"3","start":"1","tag":"tag"}],"mentions":[{"end":"6","start":"4","tag":"tag"}],"urls":[{"display_url":"Display URL","end":"9","start":"7","url":"URL"}]},"external_id":"External ID","referenced_posts":[{"post_id":"1","type":2}],"reply_settings":1,"section_id":1,"subspace_id":"1","tags":["general"],"text":"This is a text"}}` require.Equal(t, expected, string(msgCreatePost.GetSignBytes())) } @@ -206,16 +230,17 @@ var msgEditPost = types.NewMsgEditPost( 1, "Edited text", types.NewEntities( - []types.Tag{ - types.NewTag(1, 3, "tag"), + []types.TextTag{ + types.NewTextTag(1, 3, "tag"), }, - []types.Tag{ - types.NewTag(4, 6, "tag"), + []types.TextTag{ + types.NewTextTag(4, 6, "tag"), }, []types.Url{ types.NewURL(7, 9, "URL", "Display URL"), }, ), + []string{"general"}, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ) @@ -240,6 +265,7 @@ func TestMsgEditPost_ValidateBasic(t *testing.T) { msgEditPost.PostID, msgEditPost.Text, msgEditPost.Entities, + msgEditPost.Tags, msgEditPost.Editor, ), shouldErr: true, @@ -251,6 +277,7 @@ func TestMsgEditPost_ValidateBasic(t *testing.T) { 0, msgEditPost.Text, msgEditPost.Entities, + msgEditPost.Tags, msgEditPost.Editor, ), shouldErr: true, @@ -261,10 +288,23 @@ func TestMsgEditPost_ValidateBasic(t *testing.T) { msgEditPost.SubspaceID, msgEditPost.PostID, msgEditPost.Text, - types.NewEntities([]types.Tag{ - types.NewTag(1, 1, "My tag"), - types.NewTag(1, 1, "My tag"), + types.NewEntities([]types.TextTag{ + types.NewTextTag(1, 1, "My tag"), + types.NewTextTag(1, 1, "My tag"), }, nil, nil), + msgEditPost.Tags, + msgEditPost.Editor, + ), + shouldErr: true, + }, + { + name: "invalid tags return error", + msg: types.NewMsgEditPost( + msgEditPost.SubspaceID, + msgEditPost.PostID, + msgEditPost.Text, + msgEditPost.Entities, + []string{" "}, msgEditPost.Editor, ), shouldErr: true, @@ -276,6 +316,7 @@ func TestMsgEditPost_ValidateBasic(t *testing.T) { msgEditPost.PostID, msgEditPost.Text, msgEditPost.Entities, + msgEditPost.Tags, "", ), shouldErr: true, @@ -300,7 +341,7 @@ func TestMsgEditPost_ValidateBasic(t *testing.T) { } func TestMsgEditPost_GetSignBytes(t *testing.T) { - expected := `{"type":"desmos/MsgEditPost","value":{"editor":"cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd","entities":{"hashtags":[{"end":"3","start":"1","tag":"tag"}],"mentions":[{"end":"6","start":"4","tag":"tag"}],"urls":[{"display_url":"Display URL","end":"9","start":"7","url":"URL"}]},"post_id":"1","subspace_id":"1","text":"Edited text"}}` + expected := `{"type":"desmos/MsgEditPost","value":{"editor":"cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd","entities":{"hashtags":[{"end":"3","start":"1","tag":"tag"}],"mentions":[{"end":"6","start":"4","tag":"tag"}],"urls":[{"display_url":"Display URL","end":"9","start":"7","url":"URL"}]},"post_id":"1","subspace_id":"1","tags":["general"],"text":"Edited text"}}` require.Equal(t, expected, string(msgEditPost.GetSignBytes())) } diff --git a/x/posts/types/query.pb.go b/x/posts/types/query.pb.go index 1106122359..468b35691e 100644 --- a/x/posts/types/query.pb.go +++ b/x/posts/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/posts/v1/query.proto +// source: desmos/posts/v2/query.proto package types @@ -43,7 +43,7 @@ func (m *QuerySubspacePostsRequest) Reset() { *m = QuerySubspacePostsReq func (m *QuerySubspacePostsRequest) String() string { return proto.CompactTextString(m) } func (*QuerySubspacePostsRequest) ProtoMessage() {} func (*QuerySubspacePostsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{0} + return fileDescriptor_35cdbfcbe8b383b9, []int{0} } func (m *QuerySubspacePostsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -97,7 +97,7 @@ func (m *QuerySubspacePostsResponse) Reset() { *m = QuerySubspacePostsRe func (m *QuerySubspacePostsResponse) String() string { return proto.CompactTextString(m) } func (*QuerySubspacePostsResponse) ProtoMessage() {} func (*QuerySubspacePostsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{1} + return fileDescriptor_35cdbfcbe8b383b9, []int{1} } func (m *QuerySubspacePostsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -155,7 +155,7 @@ func (m *QuerySectionPostsRequest) Reset() { *m = QuerySectionPostsReque func (m *QuerySectionPostsRequest) String() string { return proto.CompactTextString(m) } func (*QuerySectionPostsRequest) ProtoMessage() {} func (*QuerySectionPostsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{2} + return fileDescriptor_35cdbfcbe8b383b9, []int{2} } func (m *QuerySectionPostsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -216,7 +216,7 @@ func (m *QuerySectionPostsResponse) Reset() { *m = QuerySectionPostsResp func (m *QuerySectionPostsResponse) String() string { return proto.CompactTextString(m) } func (*QuerySectionPostsResponse) ProtoMessage() {} func (*QuerySectionPostsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{3} + return fileDescriptor_35cdbfcbe8b383b9, []int{3} } func (m *QuerySectionPostsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +271,7 @@ func (m *QueryPostRequest) Reset() { *m = QueryPostRequest{} } func (m *QueryPostRequest) String() string { return proto.CompactTextString(m) } func (*QueryPostRequest) ProtoMessage() {} func (*QueryPostRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{4} + return fileDescriptor_35cdbfcbe8b383b9, []int{4} } func (m *QueryPostRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -323,7 +323,7 @@ func (m *QueryPostResponse) Reset() { *m = QueryPostResponse{} } func (m *QueryPostResponse) String() string { return proto.CompactTextString(m) } func (*QueryPostResponse) ProtoMessage() {} func (*QueryPostResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{5} + return fileDescriptor_35cdbfcbe8b383b9, []int{5} } func (m *QueryPostResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -374,7 +374,7 @@ func (m *QueryPostAttachmentsRequest) Reset() { *m = QueryPostAttachment func (m *QueryPostAttachmentsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPostAttachmentsRequest) ProtoMessage() {} func (*QueryPostAttachmentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{6} + return fileDescriptor_35cdbfcbe8b383b9, []int{6} } func (m *QueryPostAttachmentsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -435,7 +435,7 @@ func (m *QueryPostAttachmentsResponse) Reset() { *m = QueryPostAttachmen func (m *QueryPostAttachmentsResponse) String() string { return proto.CompactTextString(m) } func (*QueryPostAttachmentsResponse) ProtoMessage() {} func (*QueryPostAttachmentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{7} + return fileDescriptor_35cdbfcbe8b383b9, []int{7} } func (m *QueryPostAttachmentsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -497,7 +497,7 @@ func (m *QueryPollAnswersRequest) Reset() { *m = QueryPollAnswersRequest func (m *QueryPollAnswersRequest) String() string { return proto.CompactTextString(m) } func (*QueryPollAnswersRequest) ProtoMessage() {} func (*QueryPollAnswersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{8} + return fileDescriptor_35cdbfcbe8b383b9, []int{8} } func (m *QueryPollAnswersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -572,7 +572,7 @@ func (m *QueryPollAnswersResponse) Reset() { *m = QueryPollAnswersRespon func (m *QueryPollAnswersResponse) String() string { return proto.CompactTextString(m) } func (*QueryPollAnswersResponse) ProtoMessage() {} func (*QueryPollAnswersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{9} + return fileDescriptor_35cdbfcbe8b383b9, []int{9} } func (m *QueryPollAnswersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -623,7 +623,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{10} + return fileDescriptor_35cdbfcbe8b383b9, []int{10} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -661,7 +661,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8109ee6901cf86f4, []int{11} + return fileDescriptor_35cdbfcbe8b383b9, []int{11} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -698,74 +698,74 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QuerySubspacePostsRequest)(nil), "desmos.posts.v1.QuerySubspacePostsRequest") - proto.RegisterType((*QuerySubspacePostsResponse)(nil), "desmos.posts.v1.QuerySubspacePostsResponse") - proto.RegisterType((*QuerySectionPostsRequest)(nil), "desmos.posts.v1.QuerySectionPostsRequest") - proto.RegisterType((*QuerySectionPostsResponse)(nil), "desmos.posts.v1.QuerySectionPostsResponse") - proto.RegisterType((*QueryPostRequest)(nil), "desmos.posts.v1.QueryPostRequest") - proto.RegisterType((*QueryPostResponse)(nil), "desmos.posts.v1.QueryPostResponse") - proto.RegisterType((*QueryPostAttachmentsRequest)(nil), "desmos.posts.v1.QueryPostAttachmentsRequest") - proto.RegisterType((*QueryPostAttachmentsResponse)(nil), "desmos.posts.v1.QueryPostAttachmentsResponse") - proto.RegisterType((*QueryPollAnswersRequest)(nil), "desmos.posts.v1.QueryPollAnswersRequest") - proto.RegisterType((*QueryPollAnswersResponse)(nil), "desmos.posts.v1.QueryPollAnswersResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "desmos.posts.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "desmos.posts.v1.QueryParamsResponse") -} - -func init() { proto.RegisterFile("desmos/posts/v1/query.proto", fileDescriptor_8109ee6901cf86f4) } - -var fileDescriptor_8109ee6901cf86f4 = []byte{ + proto.RegisterType((*QuerySubspacePostsRequest)(nil), "desmos.posts.v2.QuerySubspacePostsRequest") + proto.RegisterType((*QuerySubspacePostsResponse)(nil), "desmos.posts.v2.QuerySubspacePostsResponse") + proto.RegisterType((*QuerySectionPostsRequest)(nil), "desmos.posts.v2.QuerySectionPostsRequest") + proto.RegisterType((*QuerySectionPostsResponse)(nil), "desmos.posts.v2.QuerySectionPostsResponse") + proto.RegisterType((*QueryPostRequest)(nil), "desmos.posts.v2.QueryPostRequest") + proto.RegisterType((*QueryPostResponse)(nil), "desmos.posts.v2.QueryPostResponse") + proto.RegisterType((*QueryPostAttachmentsRequest)(nil), "desmos.posts.v2.QueryPostAttachmentsRequest") + proto.RegisterType((*QueryPostAttachmentsResponse)(nil), "desmos.posts.v2.QueryPostAttachmentsResponse") + proto.RegisterType((*QueryPollAnswersRequest)(nil), "desmos.posts.v2.QueryPollAnswersRequest") + proto.RegisterType((*QueryPollAnswersResponse)(nil), "desmos.posts.v2.QueryPollAnswersResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "desmos.posts.v2.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "desmos.posts.v2.QueryParamsResponse") +} + +func init() { proto.RegisterFile("desmos/posts/v2/query.proto", fileDescriptor_35cdbfcbe8b383b9) } + +var fileDescriptor_35cdbfcbe8b383b9 = []byte{ // 799 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0x4d, 0x4f, 0x53, 0x4d, - 0x14, 0xc7, 0x3b, 0x50, 0x4a, 0x38, 0x7d, 0x08, 0xcf, 0x33, 0x0f, 0xa6, 0xe5, 0x82, 0xa5, 0x56, - 0xa3, 0x05, 0xe5, 0x8e, 0xc5, 0x97, 0x18, 0xdd, 0x08, 0x12, 0x94, 0x84, 0x05, 0x5e, 0x63, 0x62, - 0xdc, 0x98, 0x69, 0x3b, 0x29, 0x4d, 0xda, 0xce, 0xa5, 0x73, 0x5b, 0x25, 0x84, 0x8d, 0x71, 0xaf, - 0x89, 0x0b, 0xdd, 0x49, 0x5c, 0xbb, 0x73, 0xcb, 0x07, 0x60, 0x49, 0xe2, 0xc6, 0x95, 0x31, 0x60, - 0xfc, 0x1c, 0x66, 0x5e, 0x2e, 0xdc, 0xbe, 0x41, 0x69, 0xba, 0x70, 0xd7, 0x7b, 0xce, 0x7f, 0xce, - 0xfc, 0xe6, 0x3f, 0xf7, 0x9c, 0x5b, 0x98, 0xcc, 0x33, 0x51, 0xe6, 0x82, 0xb8, 0x5c, 0x78, 0x82, - 0xd4, 0x33, 0x64, 0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f2, 0x46, 0x57, 0x73, 0x37, 0x1c, 0xca, 0x73, 0x11, 0xf9, 0x8f, 0xf2, + 0xd6, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xde, 0x06, 0xeb, 0xa6, 0xff, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -804,7 +804,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) SubspacePosts(ctx context.Context, in *QuerySubspacePostsRequest, opts ...grpc.CallOption) (*QuerySubspacePostsResponse, error) { out := new(QuerySubspacePostsResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Query/SubspacePosts", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Query/SubspacePosts", in, out, opts...) if err != nil { return nil, err } @@ -813,7 +813,7 @@ func (c *queryClient) SubspacePosts(ctx context.Context, in *QuerySubspacePostsR func (c *queryClient) SectionPosts(ctx context.Context, in *QuerySectionPostsRequest, opts ...grpc.CallOption) (*QuerySectionPostsResponse, error) { out := new(QuerySectionPostsResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Query/SectionPosts", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Query/SectionPosts", in, out, opts...) if err != nil { return nil, err } @@ -822,7 +822,7 @@ func (c *queryClient) SectionPosts(ctx context.Context, in *QuerySectionPostsReq func (c *queryClient) Post(ctx context.Context, in *QueryPostRequest, opts ...grpc.CallOption) (*QueryPostResponse, error) { out := new(QueryPostResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Query/Post", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Query/Post", in, out, opts...) if err != nil { return nil, err } @@ -831,7 +831,7 @@ func (c *queryClient) Post(ctx context.Context, in *QueryPostRequest, opts ...gr func (c *queryClient) PostAttachments(ctx context.Context, in *QueryPostAttachmentsRequest, opts ...grpc.CallOption) (*QueryPostAttachmentsResponse, error) { out := new(QueryPostAttachmentsResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Query/PostAttachments", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Query/PostAttachments", in, out, opts...) if err != nil { return nil, err } @@ -840,7 +840,7 @@ func (c *queryClient) PostAttachments(ctx context.Context, in *QueryPostAttachme func (c *queryClient) PollAnswers(ctx context.Context, in *QueryPollAnswersRequest, opts ...grpc.CallOption) (*QueryPollAnswersResponse, error) { out := new(QueryPollAnswersResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Query/PollAnswers", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Query/PollAnswers", in, out, opts...) if err != nil { return nil, err } @@ -849,7 +849,7 @@ func (c *queryClient) PollAnswers(ctx context.Context, in *QueryPollAnswersReque func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/desmos.posts.v1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.posts.v2.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -909,7 +909,7 @@ func _Query_SubspacePosts_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Query/SubspacePosts", + FullMethod: "/desmos.posts.v2.Query/SubspacePosts", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).SubspacePosts(ctx, req.(*QuerySubspacePostsRequest)) @@ -927,7 +927,7 @@ func _Query_SectionPosts_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Query/SectionPosts", + FullMethod: "/desmos.posts.v2.Query/SectionPosts", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).SectionPosts(ctx, req.(*QuerySectionPostsRequest)) @@ -945,7 +945,7 @@ func _Query_Post_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Query/Post", + FullMethod: "/desmos.posts.v2.Query/Post", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Post(ctx, req.(*QueryPostRequest)) @@ -963,7 +963,7 @@ func _Query_PostAttachments_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Query/PostAttachments", + FullMethod: "/desmos.posts.v2.Query/PostAttachments", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).PostAttachments(ctx, req.(*QueryPostAttachmentsRequest)) @@ -981,7 +981,7 @@ func _Query_PollAnswers_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Query/PollAnswers", + FullMethod: "/desmos.posts.v2.Query/PollAnswers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).PollAnswers(ctx, req.(*QueryPollAnswersRequest)) @@ -999,7 +999,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.posts.v1.Query/Params", + FullMethod: "/desmos.posts.v2.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -1008,7 +1008,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "desmos.posts.v1.Query", + ServiceName: "desmos.posts.v2.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1037,7 +1037,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "desmos/posts/v1/query.proto", + Metadata: "desmos/posts/v2/query.proto", } func (m *QuerySubspacePostsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/posts/types/query.pb.gw.go b/x/posts/types/query.pb.gw.go index c418338c0d..3794000eb2 100644 --- a/x/posts/types/query.pb.gw.go +++ b/x/posts/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: desmos/posts/v1/query.proto +// source: desmos/posts/v2/query.proto /* Package types is a reverse proxy. diff --git a/x/posts/wasm/msg_parser_test.go b/x/posts/wasm/msg_parser_test.go index 7c2cba9e3d..65f90ac072 100644 --- a/x/posts/wasm/msg_parser_test.go +++ b/x/posts/wasm/msg_parser_test.go @@ -44,6 +44,7 @@ func TestMsgsParser_ParseCustomMsgs(t *testing.T) { 0, types.REPLY_SETTING_EVERYONE, nil, + []string{"general"}, nil, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), @@ -59,6 +60,7 @@ func TestMsgsParser_ParseCustomMsgs(t *testing.T) { 0, types.REPLY_SETTING_EVERYONE, nil, + []string{"general"}, nil, []types.PostReference{ types.NewPostReference(types.POST_REFERENCE_TYPE_QUOTE, 1, 0), @@ -73,6 +75,7 @@ func TestMsgsParser_ParseCustomMsgs(t *testing.T) { 1, "Edited text", nil, + []string{"general"}, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", )), shouldErr: false, @@ -81,6 +84,7 @@ func TestMsgsParser_ParseCustomMsgs(t *testing.T) { 1, "Edited text", nil, + []string{"general"}, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", )}, }, diff --git a/x/posts/wasm/querier_test.go b/x/posts/wasm/querier_test.go index 4a94e998fe..8179a2cf1c 100644 --- a/x/posts/wasm/querier_test.go +++ b/x/posts/wasm/querier_test.go @@ -48,6 +48,7 @@ func (suite *TestSuite) TestQuerier_QueryCustom() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -66,6 +67,7 @@ func (suite *TestSuite) TestQuerier_QueryCustom() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -90,6 +92,7 @@ func (suite *TestSuite) TestQuerier_QueryCustom() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -108,6 +111,7 @@ func (suite *TestSuite) TestQuerier_QueryCustom() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -129,6 +133,7 @@ func (suite *TestSuite) TestQuerier_QueryCustom() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -146,6 +151,7 @@ func (suite *TestSuite) TestQuerier_QueryCustom() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []types.PostReference{}, types.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), diff --git a/x/reactions/client/cli/cli_test.go b/x/reactions/client/cli/cli_test.go index 22a2dac400..b82de54e4f 100644 --- a/x/reactions/client/cli/cli_test.go +++ b/x/reactions/client/cli/cli_test.go @@ -86,6 +86,7 @@ func (s *IntegrationTestSuite) SetupSuite() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []poststypes.PostReference{}, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), @@ -100,6 +101,7 @@ func (s *IntegrationTestSuite) SetupSuite() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []poststypes.PostReference{}, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), diff --git a/x/reactions/keeper/external_hooks_test.go b/x/reactions/keeper/external_hooks_test.go index fa1c7a04ab..668fcc8fd1 100644 --- a/x/reactions/keeper/external_hooks_test.go +++ b/x/reactions/keeper/external_hooks_test.go @@ -251,6 +251,7 @@ func (suite *KeeperTestSuite) TestKeeper_AfterPostSaved() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -274,6 +275,7 @@ func (suite *KeeperTestSuite) TestKeeper_AfterPostSaved() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -290,6 +292,7 @@ func (suite *KeeperTestSuite) TestKeeper_AfterPostSaved() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -341,6 +344,7 @@ func (suite *KeeperTestSuite) TestKeeper_AfterPostDeleted() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -366,6 +370,7 @@ func (suite *KeeperTestSuite) TestKeeper_AfterPostDeleted() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/reactions/keeper/genesis_test.go b/x/reactions/keeper/genesis_test.go index bbb5db9fb1..281127f66b 100644 --- a/x/reactions/keeper/genesis_test.go +++ b/x/reactions/keeper/genesis_test.go @@ -65,6 +65,7 @@ func (suite *KeeperTestSuite) TestKeeper_ExportGenesis() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/reactions/keeper/invariants_test.go b/x/reactions/keeper/invariants_test.go index e82040f2ed..9a8b600977 100644 --- a/x/reactions/keeper/invariants_test.go +++ b/x/reactions/keeper/invariants_test.go @@ -271,6 +271,7 @@ func (suite *KeeperTestSuite) TestValidReactionsInvariant() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -309,6 +310,7 @@ func (suite *KeeperTestSuite) TestValidReactionsInvariant() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -349,6 +351,7 @@ func (suite *KeeperTestSuite) TestValidReactionsInvariant() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -389,6 +392,7 @@ func (suite *KeeperTestSuite) TestValidReactionsInvariant() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/reactions/keeper/msg_server_test.go b/x/reactions/keeper/msg_server_test.go index 67ce368f67..35df63e613 100644 --- a/x/reactions/keeper/msg_server_test.go +++ b/x/reactions/keeper/msg_server_test.go @@ -98,6 +98,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -144,6 +145,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -183,6 +185,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -237,6 +240,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -283,6 +287,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -331,6 +336,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -421,6 +427,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -568,6 +575,7 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -611,6 +619,7 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -654,6 +663,7 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -698,6 +708,7 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveReaction() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/reactions/legacy/v2/store_test.go b/x/reactions/legacy/v2/store_test.go index 905fa414a4..533496396a 100644 --- a/x/reactions/legacy/v2/store_test.go +++ b/x/reactions/legacy/v2/store_test.go @@ -129,6 +129,7 @@ func TestMigrateStore(t *testing.T) { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -144,6 +145,7 @@ func TestMigrateStore(t *testing.T) { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/reports/client/cli/cli_test.go b/x/reports/client/cli/cli_test.go index b7e90ed521..77844dcba4 100644 --- a/x/reports/client/cli/cli_test.go +++ b/x/reports/client/cli/cli_test.go @@ -81,6 +81,7 @@ func (s *IntegrationTestSuite) SetupSuite() { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", 0, nil, + nil, []poststypes.PostReference{}, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), diff --git a/x/reports/keeper/external_hooks_test.go b/x/reports/keeper/external_hooks_test.go index 01b7fe7ba2..05e34fc868 100644 --- a/x/reports/keeper/external_hooks_test.go +++ b/x/reports/keeper/external_hooks_test.go @@ -178,6 +178,7 @@ func (suite *KeeperTestsuite) TestKeeper_AfterPostDeleted() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/reports/keeper/invariants_test.go b/x/reports/keeper/invariants_test.go index 7f11f09ffa..88f1ee8967 100644 --- a/x/reports/keeper/invariants_test.go +++ b/x/reports/keeper/invariants_test.go @@ -416,6 +416,7 @@ func (suite *KeeperTestsuite) TestValidReportsInvariant() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/reports/keeper/msg_server_test.go b/x/reports/keeper/msg_server_test.go index 3d546896ed..b33e6d28c0 100644 --- a/x/reports/keeper/msg_server_test.go +++ b/x/reports/keeper/msg_server_test.go @@ -323,6 +323,7 @@ func (suite *KeeperTestsuite) TestMsgServer_CreateReport() { 1, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, diff --git a/x/reports/keeper/reports_test.go b/x/reports/keeper/reports_test.go index 421a402d63..150596c406 100644 --- a/x/reports/keeper/reports_test.go +++ b/x/reports/keeper/reports_test.go @@ -221,6 +221,7 @@ func (suite *KeeperTestsuite) TestKeeper_ValidateReport() { 0, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil, @@ -257,6 +258,7 @@ func (suite *KeeperTestsuite) TestKeeper_ValidateReport() { 0, nil, nil, + nil, poststypes.REPLY_SETTING_EVERYONE, time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), nil,