Documentation ¶
Index ¶
Constants ¶
View Source
const ( ModuleName = common.ModuleName RouterKey = common.RouterKey StoreKey = common.StoreKey ActionReportPost = common.ActionReportPost QuerierRoute = common.QuerierRoute QueryReports = common.QueryReports )
Variables ¶
View Source
var ( // variable aliases ReportsStorePrefix = common.ReportsStorePrefix ReportsTypeStorePrefix = common.ReportsTypeStorePrefix )
View Source
var ModelsCdc = codec.New()
ModelsCdc is the codec
Functions ¶
func RegisterModelsCodec ¶
RegisterModelsCodec registers concrete types on the Amino codec
func ReportStoreKey ¶
ReportsStoreKey turn an id to a key used to store a reports inside the reports store
Types ¶
type Report ¶
type Report struct { Type string `json:"type" yaml:"type"` // Identifies the type of the reports Message string `json:"message" yaml:"message"` // Contains the user message User sdk.AccAddress `json:"user" yaml:"user"` // Identifies the reporting user }
Report is the struct of a post's reports
type ReportsQueryResponse ¶
type ReportsQueryResponse struct { PostID posts.PostID `json:"post_id" yaml:"post_id"` Reports `json:"reports" yaml:"reports"` }
func NewReportResponse ¶
func NewReportResponse(postID posts.PostID, reports Reports) ReportsQueryResponse
func (ReportsQueryResponse) MarshalJSON ¶
func (response ReportsQueryResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler as Amino does not respect default json composition
func (ReportsQueryResponse) String ¶
func (response ReportsQueryResponse) String() string
String implements fmt.Stringer
func (*ReportsQueryResponse) UnmarshalJSON ¶
func (response *ReportsQueryResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler as Amino does not respect default json composition
Click to show internal directories.
Click to hide internal directories.