Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func ValidActivePollsInvariant(k Keeper) sdk.Invariant
- func ValidAttachmentsInvariant(k Keeper) sdk.Invariant
- func ValidPostsInvariant(k Keeper) sdk.Invariant
- func ValidSubspacesInvariant(k Keeper) sdk.Invariant
- func ValidUserAnswersInvariant(k Keeper) sdk.Invariant
- type Hooks
- func (h Hooks) AfterSubspaceDeleted(ctx sdk.Context, subspaceID uint64)
- func (h Hooks) AfterSubspaceGroupDeleted(sdk.Context, uint64, uint32)
- func (h Hooks) AfterSubspaceGroupMemberAdded(sdk.Context, uint64, uint32, string)
- func (h Hooks) AfterSubspaceGroupMemberRemoved(sdk.Context, uint64, uint32, string)
- func (h Hooks) AfterSubspaceGroupSaved(sdk.Context, uint64, uint32)
- func (h Hooks) AfterSubspaceSaved(ctx sdk.Context, subspaceID uint64)
- func (h Hooks) AfterSubspaceSectionDeleted(ctx sdk.Context, subspaceID uint64, sectionID uint32)
- func (h Hooks) AfterSubspaceSectionSaved(sdk.Context, uint64, uint32)
- func (h Hooks) AfterUserPermissionRemoved(sdk.Context, uint64, uint32, string)
- func (h Hooks) AfterUserPermissionSet(sdk.Context, uint64, uint32, string, subspacestypes.Permissions)
- type Keeper
- func (k Keeper) AfterAttachmentDeleted(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32)
- func (k Keeper) AfterAttachmentSaved(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32)
- func (k Keeper) AfterPollAnswerDeleted(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string)
- func (k Keeper) AfterPollAnswerSaved(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string)
- func (k Keeper) AfterPollVotingPeriodEnded(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32)
- func (k Keeper) AfterPostDeleted(ctx sdk.Context, subspaceID uint64, postID uint64)
- func (k Keeper) AfterPostSaved(ctx sdk.Context, subspaceID uint64, postID uint64)
- func (k Keeper) DeleteAttachment(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32)
- func (k Keeper) DeleteNextAttachmentID(ctx sdk.Context, subspaceID uint64, postID uint64)
- func (k Keeper) DeleteNextPostID(ctx sdk.Context, subspaceID uint64)
- func (k Keeper) DeletePost(ctx sdk.Context, subspaceID uint64, postID uint64)
- func (k Keeper) DeleteUserAnswer(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAttachment(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32) (attachment types.Attachment, found bool)
- func (k Keeper) GetNextAttachmentID(ctx sdk.Context, subspaceID uint64, postID uint64) (attachmentID uint32, err error)
- func (k Keeper) GetNextPostID(ctx sdk.Context, subspaceID uint64) (postID uint64, err error)
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) GetPoll(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32) (poll *types.Poll, found bool)
- func (k Keeper) GetPollUserAnswers(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32) []types.UserAnswer
- func (k Keeper) GetPost(ctx sdk.Context, subspaceID uint64, postID uint64) (post types.Post, found bool)
- func (k Keeper) GetPostAttachments(ctx sdk.Context, subspaceID uint64, postID uint64) []types.Attachment
- func (k Keeper) GetPosts(ctx sdk.Context) []types.Post
- func (k Keeper) GetSubspacePosts(ctx sdk.Context, subspaceID uint64) []types.Post
- func (k Keeper) GetUserAnswer(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string) (answer types.UserAnswer, found bool)
- func (k Keeper) HasAttachment(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32) bool
- func (k Keeper) HasNextAttachmentID(ctx sdk.Context, subspaceID uint64, postID uint64) bool
- func (k Keeper) HasNextPostID(ctx sdk.Context, subspaceID uint64) bool
- func (k Keeper) HasPermission(ctx sdk.Context, subspaceID uint64, sectionID uint32, user string, ...) bool
- func (k Keeper) HasPoll(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32) bool
- func (k Keeper) HasPost(ctx sdk.Context, subspaceID uint64, postID uint64) bool
- func (k Keeper) HasProfile(ctx sdk.Context, user string) bool
- func (k Keeper) HasRelationship(ctx sdk.Context, user, counterparty string, subspaceID uint64) bool
- func (k Keeper) HasSection(ctx sdk.Context, subspaceID uint64, sectionID uint32) bool
- func (k Keeper) HasSubspace(ctx sdk.Context, subspaceID uint64) bool
- func (k Keeper) HasUserAnswer(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string) bool
- func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, user string, subspaceID uint64) bool
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) InsertActivePollQueue(ctx sdk.Context, poll types.Attachment)
- func (k Keeper) IterateActivePolls(ctx sdk.Context, fn func(poll types.Attachment) (stop bool))
- func (k Keeper) IterateActivePollsQueue(ctx sdk.Context, endTime time.Time, fn func(poll types.Attachment) (stop bool))
- func (k Keeper) IterateAttachments(ctx sdk.Context, fn func(attachment types.Attachment) (stop bool))
- func (k Keeper) IteratePollUserAnswers(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, ...)
- func (k Keeper) IteratePostAttachments(ctx sdk.Context, subspaceID uint64, postID uint64, ...)
- func (k Keeper) IteratePostIDs(ctx sdk.Context, fn func(subspaceID uint64, postID uint64) (stop bool))
- func (k Keeper) IteratePosts(ctx sdk.Context, fn func(post types.Post) (stop bool))
- func (k Keeper) IterateSectionPosts(ctx sdk.Context, subspaceID uint64, sectionID uint32, ...)
- func (k Keeper) IterateSubspacePosts(ctx sdk.Context, subspaceID uint64, fn func(post types.Post) (stop bool))
- func (k Keeper) IterateUserAnswers(ctx sdk.Context, fn func(answer types.UserAnswer) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PollAnswers(ctx context.Context, request *types.QueryPollAnswersRequest) (*types.QueryPollAnswersResponse, error)
- func (k Keeper) Post(ctx context.Context, request *types.QueryPostRequest) (*types.QueryPostResponse, error)
- func (k Keeper) PostAttachments(ctx context.Context, request *types.QueryPostAttachmentsRequest) (*types.QueryPostAttachmentsResponse, error)
- func (k Keeper) RemoveFromActivePollQueue(ctx sdk.Context, poll types.Attachment)
- func (k Keeper) SaveAttachment(ctx sdk.Context, attachment types.Attachment)
- func (k Keeper) SavePost(ctx sdk.Context, post types.Post)
- func (k Keeper) SaveUserAnswer(ctx sdk.Context, answer types.UserAnswer)
- func (k Keeper) SectionPosts(ctx context.Context, request *types.QuerySectionPostsRequest) (*types.QuerySectionPostsResponse, error)
- func (k *Keeper) SetHooks(sh types.PostsHooks) *Keeper
- func (k Keeper) SetNextAttachmentID(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32)
- func (k Keeper) SetNextPostID(ctx sdk.Context, subspaceID uint64, postID uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SubspacePosts(ctx context.Context, request *types.QuerySubspacePostsRequest) (*types.QuerySubspacePostsResponse, error)
- func (k Keeper) Tally(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32) *types.PollTallyResults
- func (k Keeper) ValidatePost(ctx sdk.Context, post types.Post) error
- func (k Keeper) ValidatePostReference(ctx sdk.Context, postAuthor string, subspaceID uint64, referenceID uint64) error
- func (k Keeper) ValidatePostReply(ctx sdk.Context, postAuthor string, subspaceID uint64, referenceID uint64) error
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the stored MsgServer interface for the provided k
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all posts invariants
func ValidActivePollsInvariant ¶
ValidActivePollsInvariant checks that all the active polls are valid
func ValidAttachmentsInvariant ¶
ValidAttachmentsInvariant checks that all the attachments are valid
func ValidPostsInvariant ¶
ValidPostsInvariant checks that all the posts are valid
func ValidSubspacesInvariant ¶
ValidSubspacesInvariant checks that all the subspaces have a valid post id to them
func ValidUserAnswersInvariant ¶
ValidUserAnswersInvariant checks that all the user answers are valid
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks represents a wrapper struct
func (Hooks) AfterSubspaceDeleted ¶
AfterSubspaceDeleted implements subspacestypes.Hooks
func (Hooks) AfterSubspaceGroupDeleted ¶
AfterSubspaceGroupDeleted implements subspacestypes.Hooks
func (Hooks) AfterSubspaceGroupMemberAdded ¶
AfterSubspaceGroupMemberAdded implements subspacestypes.Hooks
func (Hooks) AfterSubspaceGroupMemberRemoved ¶
AfterSubspaceGroupMemberRemoved implements subspacestypes.Hooks
func (Hooks) AfterSubspaceGroupSaved ¶
AfterSubspaceGroupSaved implements subspacestypes.Hooks
func (Hooks) AfterSubspaceSaved ¶
AfterSubspaceSaved implements subspacestypes.Hooks
func (Hooks) AfterSubspaceSectionDeleted ¶
AfterSubspaceSectionDeleted implements subspacestypes.Hooks
func (Hooks) AfterSubspaceSectionSaved ¶
AfterSubspaceSectionSaved implements subspacestypes.Hooks
func (Hooks) AfterUserPermissionRemoved ¶
AfterUserPermissionRemoved implements subspacestypes.Hooks
func (Hooks) AfterUserPermissionSet ¶
func (h Hooks) AfterUserPermissionSet(sdk.Context, uint64, uint32, string, subspacestypes.Permissions)
AfterUserPermissionSet implements subspacestypes.Hooks
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey sdk.StoreKey, paramsSubspace paramstypes.Subspace, ak types.ProfilesKeeper, sk types.SubspacesKeeper, rk types.RelationshipsKeeper, ) Keeper
NewKeeper creates a new instance of the Posts Keeper.
func (Keeper) AfterAttachmentDeleted ¶
func (k Keeper) AfterAttachmentDeleted(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32)
AfterAttachmentDeleted implements types.PostsHooks
func (Keeper) AfterAttachmentSaved ¶
func (k Keeper) AfterAttachmentSaved(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32)
AfterAttachmentSaved implements types.PostsHooks
func (Keeper) AfterPollAnswerDeleted ¶
func (k Keeper) AfterPollAnswerDeleted(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string)
AfterPollAnswerDeleted implements types.PostsHooks
func (Keeper) AfterPollAnswerSaved ¶
func (k Keeper) AfterPollAnswerSaved(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string)
AfterPollAnswerSaved implements types.PostsHooks
func (Keeper) AfterPollVotingPeriodEnded ¶
func (k Keeper) AfterPollVotingPeriodEnded(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32)
AfterPollVotingPeriodEnded implements types.PostsHooks
func (Keeper) AfterPostDeleted ¶
AfterPostDeleted implements types.PostsHooks
func (Keeper) AfterPostSaved ¶
AfterPostSaved implements types.PostsHooks
func (Keeper) DeleteAttachment ¶
func (k Keeper) DeleteAttachment(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32)
DeleteAttachment deletes the given attachment from the current context
func (Keeper) DeleteNextAttachmentID ¶
DeleteNextAttachmentID deletes the store key used to store the next attachment id for the post having the given id
func (Keeper) DeleteNextPostID ¶
DeleteNextPostID removes the post id key for the given subspace
func (Keeper) DeletePost ¶
DeletePost deletes the given post and all its attachments from the store
func (Keeper) DeleteUserAnswer ¶
func (k Keeper) DeleteUserAnswer(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string)
DeleteUserAnswer deletes the user answer from the provided poll
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the GenesisState associated with the given context
func (Keeper) GetAttachment ¶
func (k Keeper) GetAttachment(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32) (attachment types.Attachment, found bool)
GetAttachment returns the attachment associated with the given id. If there is no attachment associated with the given id the function will return an empty attachment and false.
func (Keeper) GetNextAttachmentID ¶
func (k Keeper) GetNextAttachmentID(ctx sdk.Context, subspaceID uint64, postID uint64) (attachmentID uint32, err error)
GetNextAttachmentID gets the highest attachment id for the given post
func (Keeper) GetNextPostID ¶
GetNextPostID gets the highest post id for the given subspace
func (Keeper) GetPoll ¶
func (k Keeper) GetPoll(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32) (poll *types.Poll, found bool)
GetPoll returns the poll having the given id. If not poll with the given id is found, the function returns nil and false.
func (Keeper) GetPollUserAnswers ¶
func (k Keeper) GetPollUserAnswers(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32) []types.UserAnswer
GetPollUserAnswers returns all the user answers for the given poll
func (Keeper) GetPost ¶
func (k Keeper) GetPost(ctx sdk.Context, subspaceID uint64, postID uint64) (post types.Post, found bool)
GetPost returns the post associated with the given id. If there is no post associated with the given id the function will return an empty post and false.
func (Keeper) GetPostAttachments ¶
func (k Keeper) GetPostAttachments(ctx sdk.Context, subspaceID uint64, postID uint64) []types.Attachment
GetPostAttachments returns all the attachments associated to the given post
func (Keeper) GetSubspacePosts ¶
GetSubspacePosts returns all the posts for the given subspace
func (Keeper) GetUserAnswer ¶
func (k Keeper) GetUserAnswer(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string) (answer types.UserAnswer, found bool)
GetUserAnswer returns the user answer from the given user for the specified poll. If there is no answer result associated with the given poll and user the function will return an empty answer and false.
func (Keeper) HasAttachment ¶
func (k Keeper) HasAttachment(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32) bool
HasAttachment tells whether the given attachment exists or not
func (Keeper) HasNextAttachmentID ¶
HasNextAttachmentID checks whether the given post already has an attachment id
func (Keeper) HasNextPostID ¶
HasNextPostID tells whether the next post id key existing for the given subspace
func (Keeper) HasPermission ¶
func (k Keeper) HasPermission(ctx sdk.Context, subspaceID uint64, sectionID uint32, user string, permission subspacetypes.Permission) bool
HasPermission checks whether the given user has the provided permissions or not
func (Keeper) HasPoll ¶
HasPoll tells whether the specified post contains a poll with the provided id
func (Keeper) HasProfile ¶
HasProfile returns true iff the given user has a profile, or an error if something is wrong.
func (Keeper) HasRelationship ¶
HasRelationship tells whether the relationship between the user and counterparty exists for the given subspace
func (Keeper) HasSection ¶
HasSection tells whether the section having the given id exists inside the provided subspace
func (Keeper) HasSubspace ¶
HasSubspace checks whether the given subspace exists or not
func (Keeper) HasUserAnswer ¶
func (k Keeper) HasUserAnswer(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string) bool
HasUserAnswer tells whether a user answer to the specified poll exists
func (Keeper) HasUserBlocked ¶
HasUserBlocked tells whether the given blocker has blocked the user inside the provided subspace
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis initializes the chain state based on the given GenesisState
func (Keeper) InsertActivePollQueue ¶
func (k Keeper) InsertActivePollQueue(ctx sdk.Context, poll types.Attachment)
InsertActivePollQueue inserts a poll into the active poll queue
func (Keeper) IterateActivePolls ¶
IterateActivePolls iterates over the polls in the active polls queue and performs the provided function
func (Keeper) IterateActivePollsQueue ¶
func (k Keeper) IterateActivePollsQueue(ctx sdk.Context, endTime time.Time, fn func(poll types.Attachment) (stop bool))
IterateActivePollsQueue iterates over the polls that are still active by the time given performs the provided function
func (Keeper) IterateAttachments ¶
func (k Keeper) IterateAttachments(ctx sdk.Context, fn func(attachment types.Attachment) (stop bool))
IterateAttachments iterates over all the attachments in the given context and performs the provided function
func (Keeper) IteratePollUserAnswers ¶
func (k Keeper) IteratePollUserAnswers(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, fn func(answer types.UserAnswer) (stop bool))
IteratePollUserAnswers iterates through the answers to the given poll and performs the provided function
func (Keeper) IteratePostAttachments ¶
func (k Keeper) IteratePostAttachments(ctx sdk.Context, subspaceID uint64, postID uint64, fn func(attachment types.Attachment) (stop bool))
IteratePostAttachments iterates through the attachments associated with the provided post and performs the given function
func (Keeper) IteratePostIDs ¶
func (k Keeper) IteratePostIDs(ctx sdk.Context, fn func(subspaceID uint64, postID uint64) (stop bool))
IteratePostIDs iterates over all the next post ids and performs the provided function
func (Keeper) IteratePosts ¶
IteratePosts iterates over all the posts stored inside the context and performs the provided function
func (Keeper) IterateSectionPosts ¶
func (k Keeper) IterateSectionPosts(ctx sdk.Context, subspaceID uint64, sectionID uint32, fn func(post types.Post) (stop bool))
IterateSectionPosts iterates over all the posts stored inside the given section and performs the provided function
func (Keeper) IterateSubspacePosts ¶
func (k Keeper) IterateSubspacePosts(ctx sdk.Context, subspaceID uint64, fn func(post types.Post) (stop bool))
IterateSubspacePosts iterates over all the posts stored inside the given subspace and performs the provided function
func (Keeper) IterateUserAnswers ¶
IterateUserAnswers iterates over all the polls user answers and performs the provided function
func (Keeper) Params ¶
func (k Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements the QueryParams gRPC method
func (Keeper) PollAnswers ¶
func (k Keeper) PollAnswers(ctx context.Context, request *types.QueryPollAnswersRequest) (*types.QueryPollAnswersResponse, error)
PollAnswers implements the QueryPollAnswers gRPC method
func (Keeper) Post ¶
func (k Keeper) Post(ctx context.Context, request *types.QueryPostRequest) (*types.QueryPostResponse, error)
Post implements the QueryPost gRPC method
func (Keeper) PostAttachments ¶
func (k Keeper) PostAttachments(ctx context.Context, request *types.QueryPostAttachmentsRequest) (*types.QueryPostAttachmentsResponse, error)
PostAttachments implements the QueryPostAttachments gRPC method
func (Keeper) RemoveFromActivePollQueue ¶
func (k Keeper) RemoveFromActivePollQueue(ctx sdk.Context, poll types.Attachment)
RemoveFromActivePollQueue removes a poll from the active poll queue
func (Keeper) SaveAttachment ¶
func (k Keeper) SaveAttachment(ctx sdk.Context, attachment types.Attachment)
SaveAttachment saves the given attachment inside the current context
func (Keeper) SaveUserAnswer ¶
func (k Keeper) SaveUserAnswer(ctx sdk.Context, answer types.UserAnswer)
SaveUserAnswer stores the given poll answer into the current context
func (Keeper) SectionPosts ¶
func (k Keeper) SectionPosts(ctx context.Context, request *types.QuerySectionPostsRequest) (*types.QuerySectionPostsResponse, error)
SectionPosts implements the QuerySectionPosts gRPC method
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(sh types.PostsHooks) *Keeper
SetHooks allows to set the posts hooks
func (Keeper) SetNextAttachmentID ¶
func (k Keeper) SetNextAttachmentID(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32)
SetNextAttachmentID sets the new attachment id for the given post to the store
func (Keeper) SetNextPostID ¶
SetNextPostID sets the new post id for the given subspace to the store
func (Keeper) SubspacePosts ¶
func (k Keeper) SubspacePosts(ctx context.Context, request *types.QuerySubspacePostsRequest) (*types.QuerySubspacePostsResponse, error)
SubspacePosts implements the QuerySubspacePosts gRPC method
func (Keeper) Tally ¶
func (k Keeper) Tally(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32) *types.PollTallyResults
Tally iterates over the votes and returns the tally results of a poll
func (Keeper) ValidatePost ¶
ValidatePost validates the given post based on the current params, returning an error if anything is wrong
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶
func NewMigrator(keeper Keeper, sk types.SubspacesKeeper) Migrator
NewMigrator returns a new Migrator
func (Migrator) Migrate1to2 ¶
Migrate1to2 migrates from version 1 to 2.
func (Migrator) Migrate2to3 ¶ added in v4.1.0
Migrate2to3 migrates from version 2 to 3.