posts

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	SavePost(post types.Post) error
	HasPost(height int64, subspaceID uint64, postID uint64) (bool, error)
	DeletePost(height int64, subspaceID uint64, postID uint64) error
	DeleteAllPosts(height int64, subspaceID uint64) error
	SavePostTx(tx types.PostTransaction) error
	SavePostAttachment(attachment types.PostAttachment) error
	DeletePostAttachment(height int64, subspaceID uint64, postID uint64, attachmentID uint32) error
	SavePollAnswer(answer types.PollAnswer) error
	SavePostsParams(params types.PostsParams) error
}

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module represents the x/fees module handler

func NewModule

func NewModule(node node.Node, grpcConnection *grpc.ClientConn, cdc codec.Codec, db Database) *Module

NewModule allows to build a new Module instance

func (*Module) GetPost

func (m *Module) GetPost(height int64, subspaceID uint64, postID uint64) (types.Post, error)

GetPost gets the given post from the chain

func (*Module) GetPostAttachments

func (m *Module) GetPostAttachments(height int64, subspaceID uint64, postID uint64) ([]types.PostAttachment, error)

func (*Module) GetPostTxHashes

func (m *Module) GetPostTxHashes(txs []*coretypes.ResultTx, post types.Post) []types.PostTransaction

GetPostTxHashes filters the given transactions and returns only the ones related to the given post

func (*Module) HandleBlock

func (m *Module) HandleBlock(block *coretypes.ResultBlock, results *coretypes.ResultBlockResults, _ []*juno.Tx, _ *coretypes.ResultValidators) error

HandleBlock implements modules.BlockModule

func (*Module) HandleGenesis

func (m *Module) HandleGenesis(doc *tmtypes.GenesisDoc, appState map[string]json.RawMessage) error

HandleGenesis implements modules.GenesisModule

func (*Module) HandleMsg

func (m *Module) HandleMsg(index int, msg sdk.Msg, tx *juno.Tx) error

HandleMsg implements modules.MessageModule

func (*Module) HandleMsgExec

func (m *Module) HandleMsgExec(index int, _ *authz.MsgExec, _ int, executedMsg sdk.Msg, tx *juno.Tx) error

HandleMsgExec implements modules.AuthzMessageModule

func (*Module) Name

func (m *Module) Name() string

Name implements modules.Module

func (*Module) QueryPostAttachments

func (m *Module) QueryPostAttachments(height int64, subspaceID uint64, postID uint64) ([]types.PostAttachment, error)

QueryPostAttachments queries all the attachments for the given post at the provided height

func (*Module) QueryPostsTxs

func (m *Module) QueryPostsTxs(height int64, subspaceID uint64) ([]*coretypes.ResultTx, error)

QueryPostsTxs queries all the posts transactions made inside the given subspace

func (*Module) QuerySubspacePosts

func (m *Module) QuerySubspacePosts(height int64, subspaceID uint64) ([]types.Post, error)

QuerySubspacePosts queries all the posts present inside the given subspace at the provided height

func (*Module) RefreshPostData

func (m *Module) RefreshPostData(height int64, postTxs []types.PostTransaction, post types.Post) error

RefreshPostData refreshes the data associated with the given post at the specified height

func (*Module) RefreshPostsData

func (m *Module) RefreshPostsData(height int64, subspaceID uint64) error

RefreshPostsData refreshes all the posts' data for the given subspace

func (*Module) RegisterPeriodicOperations

func (m *Module) RegisterPeriodicOperations(scheduler *gocron.Scheduler) error

RegisterPeriodicOperations implements modules.PeriodicOperationsModule

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL