types

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypePost             = "post"
	EventTypeUpvote           = "upvote"
	EventTypeCurationComplete = "curation_complete"
	EventTypeProtocolReward   = "protocol_reward"

	AttributeKeyVendorID           = "vendor_id"
	AttributeKeyPostID             = "post_id"
	AttributeKeyCreator            = "creator"
	AttributeKeyCurator            = "curator"
	AttributeKeyRewardAccount      = "reward_account"
	AttributeKeyBodyHash           = "body_hash"
	AttributeKeyBody               = "body"
	AttributeCurationEndTime       = "curation_end_time"
	AttributeKeyVoteNumber         = "vote_number"
	AttributeKeyVoteAmount         = "vote_amount"
	AttributeKeyVoteDenom          = "vote_denom"
	AttributeKeyProtocolRewardType = "reward_type"
	AttributeKeyRewardAmount       = "reward_amount"
	AttributeKeyChainID            = "chain_id"
	AttributeKeyContractAddress    = "contract_address"
	AttributeKeyMetadata           = "metadata"
	AttributeKeyParentID           = "parent_id"
	AttributeKeyLocked             = "locked"

	AttributeValueCategory = ModuleName
)

curating module event types

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "curating"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey to be used for routing msgs
	RouterKey = ModuleName

	// QuerierKey to be used for querierer msgs
	QuerierKey = ModuleName

	// RewardPoolName is the name for the module account for the reward pool
	RewardPoolName = "reward_matching_pool"

	// VotingPoolName is the name of the global voting pool module account
	VotingPoolName = "voting_pool"

	// DefaultStakeDenom is the staking denom for the zone
	DefaultStakeDenom = "ustb"

	// DefaultVoteDenom is the denom for quadratic voting
	DefaultVoteDenom = "ucredits"
)
View Source
const (
	TypeMsgPost   = "curating_post"
	TypeMsgUpvote = "curating_upvote"
)

msg types

View Source
const (
	DefaultParamspace        string        = ModuleName
	DefaultCurationWindow    time.Duration = time.Minute * 10
	DefaultMaxNumVotes       uint32        = 5
	DefaultMaxVendors        uint32        = 1
	DefaultMaxPostBodyLength uint32        = 280
)

Default parameter namespace

Variables

View Source
var (
	ErrInvalidLengthCurating        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCurating          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCurating = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrPostNotFound  = sdkerrors.Register(ModuleName, 1, "Post not found")
	ErrAlreadyVoted  = sdkerrors.Register(ModuleName, 2, "Already voted")
	ErrDuplicatePost = sdkerrors.Register(ModuleName, 3, "Post already exists")
	ErrPostExpired   = sdkerrors.Register(ModuleName, 4, "Post already expired")
	ErrInvalidPostID = sdkerrors.Register(ModuleName, 5, "PostID cannot be nil")
)

x/curating module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// KeyPrefixPost 0x00 | vendor_id | post_id -> Post
	KeyPrefixPost = []byte{0x00}

	// KeyPrefixUpvote 0x01 | vendor_id | post_id | curator -> Upvote
	KeyPrefixUpvote = []byte{0x01}

	// KeyPrefixCurationQueue 0x02 | format(curation_end_time) -> []VPPair
	KeyPrefixCurationQueue = []byte{0x02}

	// PostIDKey for native posts (vendor = 0)
	PostIDKey = []byte{0x03}
)
View Source
var (
	DefaultVoteAmount                      = sdk.NewInt64Coin(DefaultVoteDenom, 1_000_000)
	DefaultInitialRewardPool               = sdk.NewInt64Coin(DefaultStakeDenom, 21_000_000_000_000)
	DefaultRewardPoolAllocation            = sdk.NewDecWithPrec(50, 2) // from inflation
	DefaultRewardPoolCurationMaxAllocation = sdk.NewDecWithPrec(1, 3)  // .001 (0.1%)
)

Default vars

View Source
var (
	KeyCurationWindow             = []byte("CurationWindow")
	KeyVoteAmount                 = []byte("VoteAmount")
	KeyMaxNumVotes                = []byte("MaxNumVotes")
	KeyMaxVendors                 = []byte("MaxVendors")
	KeyMaxPostBodyLength          = []byte("MaxPostBodyLength")
	KeyRewardPoolAllocation       = []byte("RewardPoolAllocation")
	KeyRewardPoolCurationMaxAlloc = []byte("RewardPoolCurationMaxAlloc")
	KeyInitialRewardPool          = []byte("InitialRewardPool")
	KeyStakeDenom                 = []byte("StakeDenom")
)

Parameter store keys

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// ModuleCdc references the global x/curating module codec. Note, the codec
	// should ONLY be used in certain instances of tests and for JSON encoding.
	ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
)

Functions

func CurationQueueByTimeKey

func CurationQueueByTimeKey(curationEndTime time.Time) []byte

CurationQueueByTimeKey gets the curation queue key by curation end time

func GetPostIDBytes added in v0.6.0

func GetPostIDBytes(postID uint64) (postIDBz []byte)

GetPostIDBytes returns the byte representation of the postlID

func GetPostIDFromBytes added in v0.6.0

func GetPostIDFromBytes(bz []byte) (postID uint64)

GetPostIDFromBytes returns postID in uint64 format from a byte array

func PostKey

func PostKey(vendorID uint32, postID PostID) []byte

PostKey is the key used to store a post

func PostsKey

func PostsKey(vendorID uint32) []byte

PostsKey is an index on all posts for a vendor

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the curating module interfaces to protobuf Any.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func UpvoteKey

func UpvoteKey(vendorID uint32, postID PostID, curator sdk.AccAddress) []byte

UpvoteKey key is the key used to store an upvote

func UpvotePrefixKey

func UpvotePrefixKey(vendorID uint32, postID PostID) []byte

UpvotePrefixKey 0x01|vendorID|postID|...

Types

type AccountKeeper

type AccountKeeper interface {
	IterateAccounts(ctx sdk.Context, process func(authtypes.AccountI) (stop bool))
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI // only used for simulation

	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI

	// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
	SetModuleAccount(sdk.Context, authtypes.ModuleAccountI)
}

AccountKeeper defines the expected account keeper (noalias)

type BankKeeper

type BankKeeper interface {
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	SetBalances(ctx sdk.Context, addr sdk.AccAddress, balances sdk.Coins) error
	LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins

	SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type BodyHash

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

func BodyHashFromString

func BodyHashFromString(body string) (BodyHash, error)

BodyHashFromString does exactly whats on the label

func (BodyHash) Marshal

func (b BodyHash) Marshal() ([]byte, error)

Marshal implements the gogo proto custom type interface

func (BodyHash) MarshalJSON

func (b BodyHash) MarshalJSON() ([]byte, error)

MarshalJSON implements the gogo proto custom type interface

func (BodyHash) MarshalTo

func (b BodyHash) MarshalTo(data []byte) (n int, err error)

MarshalTo implements the gogo proto custom type interface

func (BodyHash) Size

func (b BodyHash) Size() int

Size implements the gogo proto custom type interface

func (*BodyHash) String

func (b *BodyHash) String() string

String returns the hex string of the body hash

func (*BodyHash) Unmarshal

func (b *BodyHash) Unmarshal(data []byte) error

Unmarshal implements the gogo proto custom type interface

func (*BodyHash) UnmarshalJSON

func (b *BodyHash) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the gogo proto custom type interface

type CuratingQueue

type CuratingQueue []VPPair

CuratingQueue is a collection of VPPairs objects

type CustomProtobufType

type CustomProtobufType interface {
	Marshal() ([]byte, error)
	MarshalTo(data []byte) (n int, err error)
	Unmarshal(data []byte) error
	Size() int

	MarshalJSON() ([]byte, error)
	UnmarshalJSON(data []byte) error
}

CustomProtobufType defines the interface custom gogo proto types must implement in order to be used as a "customtype" extension.

ref: https://github.com/gogo/protobuf/blob/master/custom_types.md

type GenesisState

type GenesisState struct {
	Params        Params        `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	Posts         Posts         `protobuf:"bytes,3,rep,name=posts,proto3,castrepeated=Posts" json:"posts"`
	Upvotes       Upvotes       `protobuf:"bytes,4,rep,name=upvotes,proto3,castrepeated=Upvotes" json:"upvotes"`
	CuratingQueue CuratingQueue `protobuf:"bytes,5,rep,name=curating_queue,json=curatingQueue,proto3,castrepeated=CuratingQueue" json:"curating_queue"`
}

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState - default GenesisState

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetCuratingQueue

func (m *GenesisState) GetCuratingQueue() CuratingQueue

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPosts

func (m *GenesisState) GetPosts() Posts

func (*GenesisState) GetUpvotes

func (m *GenesisState) GetUpvotes() Upvotes

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate validates the x/curating genesis parameters

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	// Post defines a method for sending a post
	Post(ctx context.Context, in *MsgPost, opts ...grpc.CallOption) (*MsgPostResponse, error)
	// Upvote defines a method for upvoting a post
	Upvote(ctx context.Context, in *MsgUpvote, opts ...grpc.CallOption) (*MsgUpvoteResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgPost

type MsgPost struct {
	VendorID        uint32  `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"`
	PostID          string  `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id" yaml:"post_id"`
	Creator         string  `protobuf:"bytes,3,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"`
	RewardAccount   string  `protobuf:"bytes,4,opt,name=reward_account,json=rewardAccount,proto3" json:"reward_account,omitempty" yaml:"reward_account"`
	Body            string  `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty" yaml:"body"`
	ChainID         string  `protobuf:"bytes,6,opt,name=chain_id,json=chainId,proto3" json:"chain_id" yaml:"chain_id"`
	ContractAddress string  `` /* 130-byte string literal not displayed */
	Metadata        string  `protobuf:"bytes,8,opt,name=metadata,proto3" json:"metadata,omitempty" yaml:"metadata"`
	ParentID        *PostID `protobuf:"bytes,9,opt,name=parent_id,json=parentId,proto3,customtype=PostID" json:"parent_id" yaml:"parent_id"`
}

func NewMsgPost

func NewMsgPost(
	vendorID uint32,
	postID string,
	creator,
	rewardAccount sdk.AccAddress,
	body string,
) *MsgPost

NewMsgPost creates a new MsgPost instance

func (*MsgPost) Descriptor

func (*MsgPost) Descriptor() ([]byte, []int)

func (*MsgPost) Equal

func (this *MsgPost) Equal(that interface{}) bool

func (*MsgPost) GetBody

func (m *MsgPost) GetBody() string

func (*MsgPost) GetChainID added in v0.6.0

func (m *MsgPost) GetChainID() string

func (*MsgPost) GetContractAddress added in v0.6.0

func (m *MsgPost) GetContractAddress() string

func (*MsgPost) GetCreator

func (m *MsgPost) GetCreator() string

func (*MsgPost) GetMetadata added in v0.6.0

func (m *MsgPost) GetMetadata() string

func (*MsgPost) GetPostID

func (m *MsgPost) GetPostID() string

func (*MsgPost) GetRewardAccount

func (m *MsgPost) GetRewardAccount() string

func (MsgPost) GetSignBytes

func (msg MsgPost) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgPost) GetSigners

func (msg MsgPost) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgPost) GetVendorID

func (m *MsgPost) GetVendorID() uint32

func (*MsgPost) Marshal

func (m *MsgPost) Marshal() (dAtA []byte, err error)

func (*MsgPost) MarshalTo

func (m *MsgPost) MarshalTo(dAtA []byte) (int, error)

func (*MsgPost) MarshalToSizedBuffer

func (m *MsgPost) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgPost) ProtoMessage

func (*MsgPost) ProtoMessage()

func (*MsgPost) Reset

func (m *MsgPost) Reset()

func (MsgPost) Route

func (msg MsgPost) Route() string

Route implements sdk.Msg

func (*MsgPost) Size

func (m *MsgPost) Size() (n int)

func (*MsgPost) String

func (m *MsgPost) String() string

func (MsgPost) Type

func (msg MsgPost) Type() string

Type implements sdk.Msg

func (*MsgPost) Unmarshal

func (m *MsgPost) Unmarshal(dAtA []byte) error

func (MsgPost) ValidateBasic

func (msg MsgPost) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

func (*MsgPost) XXX_DiscardUnknown

func (m *MsgPost) XXX_DiscardUnknown()

func (*MsgPost) XXX_Marshal

func (m *MsgPost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgPost) XXX_Merge

func (m *MsgPost) XXX_Merge(src proto.Message)

func (*MsgPost) XXX_Size

func (m *MsgPost) XXX_Size() int

func (*MsgPost) XXX_Unmarshal

func (m *MsgPost) XXX_Unmarshal(b []byte) error

type MsgPostResponse

type MsgPostResponse struct {
	PostID string `protobuf:"bytes,1,opt,name=post_id,json=postId,proto3" json:"post_id" yaml:"post_id"`
}

func (*MsgPostResponse) Descriptor

func (*MsgPostResponse) Descriptor() ([]byte, []int)

func (*MsgPostResponse) GetPostID added in v0.6.0

func (m *MsgPostResponse) GetPostID() string

func (*MsgPostResponse) Marshal

func (m *MsgPostResponse) Marshal() (dAtA []byte, err error)

func (*MsgPostResponse) MarshalTo

func (m *MsgPostResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgPostResponse) MarshalToSizedBuffer

func (m *MsgPostResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgPostResponse) ProtoMessage

func (*MsgPostResponse) ProtoMessage()

func (*MsgPostResponse) Reset

func (m *MsgPostResponse) Reset()

func (*MsgPostResponse) Size

func (m *MsgPostResponse) Size() (n int)

func (*MsgPostResponse) String

func (m *MsgPostResponse) String() string

func (*MsgPostResponse) Unmarshal

func (m *MsgPostResponse) Unmarshal(dAtA []byte) error

func (*MsgPostResponse) XXX_DiscardUnknown

func (m *MsgPostResponse) XXX_DiscardUnknown()

func (*MsgPostResponse) XXX_Marshal

func (m *MsgPostResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgPostResponse) XXX_Merge

func (m *MsgPostResponse) XXX_Merge(src proto.Message)

func (*MsgPostResponse) XXX_Size

func (m *MsgPostResponse) XXX_Size() int

func (*MsgPostResponse) XXX_Unmarshal

func (m *MsgPostResponse) XXX_Unmarshal(b []byte) error

type MsgServer

type MsgServer interface {
	// Post defines a method for sending a post
	Post(context.Context, *MsgPost) (*MsgPostResponse, error)
	// Upvote defines a method for upvoting a post
	Upvote(context.Context, *MsgUpvote) (*MsgUpvoteResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpvote

type MsgUpvote struct {
	VendorID      uint32 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"`
	PostID        string `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id" yaml:"post_id"`
	Curator       string `protobuf:"bytes,3,opt,name=curator,proto3" json:"curator,omitempty" yaml:"curator"`
	RewardAccount string `protobuf:"bytes,4,opt,name=reward_account,json=rewardAccount,proto3" json:"reward_account,omitempty" yaml:"reward_account"`
	VoteNum       int32  `protobuf:"varint,5,opt,name=vote_num,json=voteNum,proto3" json:"vote_num,omitempty"`
}

func NewMsgUpvote

func NewMsgUpvote(vendorID uint32, postID string, curator, rewardAccount sdk.AccAddress, voteNum int32) *MsgUpvote

NewMsgUpvote creates a new MsgUpvote instance

func (*MsgUpvote) Descriptor

func (*MsgUpvote) Descriptor() ([]byte, []int)

func (*MsgUpvote) Equal

func (this *MsgUpvote) Equal(that interface{}) bool

func (*MsgUpvote) GetCurator

func (m *MsgUpvote) GetCurator() string

func (*MsgUpvote) GetPostID

func (m *MsgUpvote) GetPostID() string

func (*MsgUpvote) GetRewardAccount

func (m *MsgUpvote) GetRewardAccount() string

func (MsgUpvote) GetSignBytes

func (msg MsgUpvote) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgUpvote) GetSigners

func (msg MsgUpvote) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgUpvote) GetVendorID

func (m *MsgUpvote) GetVendorID() uint32

func (*MsgUpvote) GetVoteNum

func (m *MsgUpvote) GetVoteNum() int32

func (*MsgUpvote) Marshal

func (m *MsgUpvote) Marshal() (dAtA []byte, err error)

func (*MsgUpvote) MarshalTo

func (m *MsgUpvote) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpvote) MarshalToSizedBuffer

func (m *MsgUpvote) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpvote) ProtoMessage

func (*MsgUpvote) ProtoMessage()

func (*MsgUpvote) Reset

func (m *MsgUpvote) Reset()

func (MsgUpvote) Route

func (msg MsgUpvote) Route() string

Route implements sdk.Msg

func (*MsgUpvote) Size

func (m *MsgUpvote) Size() (n int)

func (*MsgUpvote) String

func (m *MsgUpvote) String() string

func (MsgUpvote) Type

func (msg MsgUpvote) Type() string

Type implements sdk.Msg

func (*MsgUpvote) Unmarshal

func (m *MsgUpvote) Unmarshal(dAtA []byte) error

func (MsgUpvote) ValidateBasic

func (msg MsgUpvote) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

func (*MsgUpvote) XXX_DiscardUnknown

func (m *MsgUpvote) XXX_DiscardUnknown()

func (*MsgUpvote) XXX_Marshal

func (m *MsgUpvote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpvote) XXX_Merge

func (m *MsgUpvote) XXX_Merge(src proto.Message)

func (*MsgUpvote) XXX_Size

func (m *MsgUpvote) XXX_Size() int

func (*MsgUpvote) XXX_Unmarshal

func (m *MsgUpvote) XXX_Unmarshal(b []byte) error

type MsgUpvoteResponse

type MsgUpvoteResponse struct {
}

func (*MsgUpvoteResponse) Descriptor

func (*MsgUpvoteResponse) Descriptor() ([]byte, []int)

func (*MsgUpvoteResponse) Marshal

func (m *MsgUpvoteResponse) Marshal() (dAtA []byte, err error)

func (*MsgUpvoteResponse) MarshalTo

func (m *MsgUpvoteResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpvoteResponse) MarshalToSizedBuffer

func (m *MsgUpvoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpvoteResponse) ProtoMessage

func (*MsgUpvoteResponse) ProtoMessage()

func (*MsgUpvoteResponse) Reset

func (m *MsgUpvoteResponse) Reset()

func (*MsgUpvoteResponse) Size

func (m *MsgUpvoteResponse) Size() (n int)

func (*MsgUpvoteResponse) String

func (m *MsgUpvoteResponse) String() string

func (*MsgUpvoteResponse) Unmarshal

func (m *MsgUpvoteResponse) Unmarshal(dAtA []byte) error

func (*MsgUpvoteResponse) XXX_DiscardUnknown

func (m *MsgUpvoteResponse) XXX_DiscardUnknown()

func (*MsgUpvoteResponse) XXX_Marshal

func (m *MsgUpvoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpvoteResponse) XXX_Merge

func (m *MsgUpvoteResponse) XXX_Merge(src proto.Message)

func (*MsgUpvoteResponse) XXX_Size

func (m *MsgUpvoteResponse) XXX_Size() int

func (*MsgUpvoteResponse) XXX_Unmarshal

func (m *MsgUpvoteResponse) XXX_Unmarshal(b []byte) error

type Params

type Params struct {
	CurationWindow             time.Duration                          `` /* 128-byte string literal not displayed */
	VoteAmount                 types.Coin                             `protobuf:"bytes,2,opt,name=vote_amount,json=voteAmount,proto3" json:"vote_amount" yaml:"vote_amount"`
	MaxNumVotes                uint32                                 `protobuf:"varint,3,opt,name=max_num_votes,json=maxNumVotes,proto3" json:"max_num_votes" yaml:"max_num_votes"`
	MaxVendors                 uint32                                 `protobuf:"varint,4,opt,name=max_vendors,json=maxVendors,proto3" json:"max_vendors" yaml:"max_vendors"`
	RewardPoolAllocation       github_com_cosmos_cosmos_sdk_types.Dec `` /* 193-byte string literal not displayed */
	MaxPostBodyLength          uint32                                 `` /* 135-byte string literal not displayed */
	RewardPoolCurationMaxAlloc github_com_cosmos_cosmos_sdk_types.Dec `` /* 233-byte string literal not displayed */
	InitialRewardPool          types.Coin                             `` /* 131-byte string literal not displayed */
	StakeDenom                 string                                 `protobuf:"bytes,10,opt,name=stake_denom,json=stakeDenom,proto3" json:"stake_denom" yaml:"stake_denom"`
}

func DefaultParams

func DefaultParams() Params

DefaultParams defines the parameters for this module

func NewParams

func NewParams(
	curationWindow time.Duration,
	voteAmount,
	initialRewardPool sdk.Coin,
	maxNumVotes,
	maxVendors uint32,
	maxPostBodyLength uint32,
	rewardPoolAllocation,
	rewardPoolCurationMaxAllocation sdk.Dec,
	stakeDenom string,
) Params

NewParams creates a new Params object

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetCurationWindow

func (m *Params) GetCurationWindow() time.Duration

func (*Params) GetInitialRewardPool

func (m *Params) GetInitialRewardPool() types.Coin

func (*Params) GetMaxNumVotes

func (m *Params) GetMaxNumVotes() uint32

func (*Params) GetMaxPostBodyLength added in v0.6.0

func (m *Params) GetMaxPostBodyLength() uint32

func (*Params) GetMaxVendors

func (m *Params) GetMaxVendors() uint32

func (*Params) GetStakeDenom

func (m *Params) GetStakeDenom() string

func (*Params) GetVoteAmount

func (m *Params) GetVoteAmount() types.Coin

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs - Implements params.ParamSet

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (Params) String

func (p Params) String() string

String implements the stringer interface for Params

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate validates all params

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type Post

type Post struct {
	VendorID        uint32     `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"`
	PostID          PostID     `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3,customtype=PostID" json:"post_id" yaml:"post_id"`
	Creator         string     `protobuf:"bytes,3,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"`
	RewardAccount   string     `protobuf:"bytes,4,opt,name=reward_account,json=rewardAccount,proto3" json:"reward_account,omitempty" yaml:"reward_account"`
	BodyHash        BodyHash   `protobuf:"bytes,5,opt,name=body_hash,json=bodyHash,proto3,customtype=BodyHash" json:"body_hash" yaml:"body_hash"`
	Body            string     `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty" yaml:"body"`
	CuratingEndTime time.Time  `` /* 131-byte string literal not displayed */
	TotalVotes      uint64     `protobuf:"varint,8,opt,name=total_votes,json=totalVotes,proto3" json:"total_votes" yaml:"total_votes"`
	TotalVoters     uint64     `protobuf:"varint,9,opt,name=total_voters,json=totalVoters,proto3" json:"total_voters" yaml:"total_voters"`
	TotalAmount     types.Coin `protobuf:"bytes,10,opt,name=total_amount,json=totalAmount,proto3" json:"total_amount" yaml:"total_amount"`
	ChainID         string     `protobuf:"bytes,11,opt,name=chain_id,json=chainId,proto3" json:"chain_id" yaml:"chain_id"`
	Owner           string     `protobuf:"bytes,12,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"`
	ContractAddress string     `` /* 131-byte string literal not displayed */
	Metadata        string     `protobuf:"bytes,14,opt,name=metadata,proto3" json:"metadata,omitempty" yaml:"metadata"`
	Locked          bool       `protobuf:"varint,15,opt,name=locked,proto3" json:"locked,omitempty" yaml:"locked"`
	ParentID        *PostID    `protobuf:"bytes,16,opt,name=parent_id,json=parentId,proto3,customtype=PostID" json:"parent_id" yaml:"parent_id"`
}

func NewPost

func NewPost(
	vendorID uint32, postID PostID, bodyHash BodyHash, body string, creator,
	rewardAccount sdk.AccAddress, curatingEndTime time.Time,
	chainID string, owner sdk.AccAddress, contractAddress sdk.AccAddress,
	metaData string, locked bool, parentID *PostID) Post

NewPost allocates and returns a new `Post` struct

func (*Post) Descriptor

func (*Post) Descriptor() ([]byte, []int)

func (*Post) GetBody added in v0.6.0

func (m *Post) GetBody() string

func (*Post) GetChainID added in v0.6.0

func (m *Post) GetChainID() string

func (*Post) GetContractAddress added in v0.6.0

func (m *Post) GetContractAddress() string

func (*Post) GetCreator

func (m *Post) GetCreator() string

func (*Post) GetCuratingEndTime

func (m *Post) GetCuratingEndTime() time.Time

func (*Post) GetLocked added in v0.6.0

func (m *Post) GetLocked() bool

func (*Post) GetMetadata added in v0.6.0

func (m *Post) GetMetadata() string

func (*Post) GetOwner added in v0.6.0

func (m *Post) GetOwner() string

func (*Post) GetRewardAccount

func (m *Post) GetRewardAccount() string

func (*Post) GetTotalAmount

func (m *Post) GetTotalAmount() types.Coin

func (*Post) GetTotalVoters

func (m *Post) GetTotalVoters() uint64

func (*Post) GetTotalVotes

func (m *Post) GetTotalVotes() uint64

func (*Post) GetVendorID

func (m *Post) GetVendorID() uint32

func (*Post) Marshal

func (m *Post) Marshal() (dAtA []byte, err error)

func (*Post) MarshalTo

func (m *Post) MarshalTo(dAtA []byte) (int, error)

func (*Post) MarshalToSizedBuffer

func (m *Post) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Post) ProtoMessage

func (*Post) ProtoMessage()

func (*Post) Reset

func (m *Post) Reset()

func (*Post) Size

func (m *Post) Size() (n int)

func (*Post) String

func (m *Post) String() string

func (*Post) Unmarshal

func (m *Post) Unmarshal(dAtA []byte) error

func (*Post) XXX_DiscardUnknown

func (m *Post) XXX_DiscardUnknown()

func (*Post) XXX_Marshal

func (m *Post) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Post) XXX_Merge

func (m *Post) XXX_Merge(src proto.Message)

func (*Post) XXX_Size

func (m *Post) XXX_Size() int

func (*Post) XXX_Unmarshal

func (m *Post) XXX_Unmarshal(b []byte) error

type PostID

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

PostID represents a Twitter post ID (for now)

func PostIDFromInt64 added in v0.6.0

func PostIDFromInt64(id int64) PostID

PostIDFromInt64 does exactly whats on the label

func PostIDFromString

func PostIDFromString(id string) (PostID, error)

PostIDFromString does exactly whats on the label

func (PostID) Bytes

func (p PostID) Bytes() []byte

Bytes returns bytes in big endian

func (PostID) Equal

func (p PostID) Equal(p2 PostID) bool

Equal compares post id is the same

func (PostID) Marshal

func (p PostID) Marshal() ([]byte, error)

Marshal implements the gogo proto custom type interface

func (PostID) MarshalJSON

func (p PostID) MarshalJSON() ([]byte, error)

MarshalJSON implements the gogo proto custom type interface

func (PostID) MarshalTo

func (p PostID) MarshalTo(data []byte) (n int, err error)

MarshalTo implements the gogo proto custom type interface

func (PostID) Size

func (p PostID) Size() int

Size implements the gogo proto custom type interface

func (PostID) String

func (p PostID) String() string

String like the array of chars, not the theory

func (*PostID) Unmarshal

func (p *PostID) Unmarshal(data []byte) error

Unmarshal implements the gogo proto custom type interface

func (*PostID) UnmarshalJSON

func (p *PostID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the gogo proto custom type interface

type Posts

type Posts []Post

Posts is a collection of Post objects

type QueryClient

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest

type QueryParamsRequest struct {
}

func (*QueryParamsRequest) Descriptor

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse

type QueryParamsResponse struct {
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

func (*QueryParamsResponse) Descriptor

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryPostRequest

type QueryPostRequest struct {
	VendorId uint32 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id,omitempty"`
	PostId   string `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
}

func (*QueryPostRequest) Descriptor

func (*QueryPostRequest) Descriptor() ([]byte, []int)

func (*QueryPostRequest) Marshal

func (m *QueryPostRequest) Marshal() (dAtA []byte, err error)

func (*QueryPostRequest) MarshalTo

func (m *QueryPostRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryPostRequest) MarshalToSizedBuffer

func (m *QueryPostRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPostRequest) ProtoMessage

func (*QueryPostRequest) ProtoMessage()

func (*QueryPostRequest) Reset

func (m *QueryPostRequest) Reset()

func (*QueryPostRequest) Size

func (m *QueryPostRequest) Size() (n int)

func (*QueryPostRequest) String

func (m *QueryPostRequest) String() string

func (*QueryPostRequest) Unmarshal

func (m *QueryPostRequest) Unmarshal(dAtA []byte) error

func (*QueryPostRequest) XXX_DiscardUnknown

func (m *QueryPostRequest) XXX_DiscardUnknown()

func (*QueryPostRequest) XXX_Marshal

func (m *QueryPostRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPostRequest) XXX_Merge

func (m *QueryPostRequest) XXX_Merge(src proto.Message)

func (*QueryPostRequest) XXX_Size

func (m *QueryPostRequest) XXX_Size() int

func (*QueryPostRequest) XXX_Unmarshal

func (m *QueryPostRequest) XXX_Unmarshal(b []byte) error

type QueryPostResponse

type QueryPostResponse struct {
	Post *Post `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"`
}

func (*QueryPostResponse) Descriptor

func (*QueryPostResponse) Descriptor() ([]byte, []int)

func (*QueryPostResponse) GetPost

func (m *QueryPostResponse) GetPost() *Post

func (*QueryPostResponse) Marshal

func (m *QueryPostResponse) Marshal() (dAtA []byte, err error)

func (*QueryPostResponse) MarshalTo

func (m *QueryPostResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryPostResponse) MarshalToSizedBuffer

func (m *QueryPostResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPostResponse) ProtoMessage

func (*QueryPostResponse) ProtoMessage()

func (*QueryPostResponse) Reset

func (m *QueryPostResponse) Reset()

func (*QueryPostResponse) Size

func (m *QueryPostResponse) Size() (n int)

func (*QueryPostResponse) String

func (m *QueryPostResponse) String() string

func (*QueryPostResponse) Unmarshal

func (m *QueryPostResponse) Unmarshal(dAtA []byte) error

func (*QueryPostResponse) XXX_DiscardUnknown

func (m *QueryPostResponse) XXX_DiscardUnknown()

func (*QueryPostResponse) XXX_Marshal

func (m *QueryPostResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPostResponse) XXX_Merge

func (m *QueryPostResponse) XXX_Merge(src proto.Message)

func (*QueryPostResponse) XXX_Size

func (m *QueryPostResponse) XXX_Size() int

func (*QueryPostResponse) XXX_Unmarshal

func (m *QueryPostResponse) XXX_Unmarshal(b []byte) error

type QueryPostsRequest

type QueryPostsRequest struct {
	VendorId uint32 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id,omitempty"`
}

func (*QueryPostsRequest) Descriptor

func (*QueryPostsRequest) Descriptor() ([]byte, []int)

func (*QueryPostsRequest) Marshal

func (m *QueryPostsRequest) Marshal() (dAtA []byte, err error)

func (*QueryPostsRequest) MarshalTo

func (m *QueryPostsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryPostsRequest) MarshalToSizedBuffer

func (m *QueryPostsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPostsRequest) ProtoMessage

func (*QueryPostsRequest) ProtoMessage()

func (*QueryPostsRequest) Reset

func (m *QueryPostsRequest) Reset()

func (*QueryPostsRequest) Size

func (m *QueryPostsRequest) Size() (n int)

func (*QueryPostsRequest) String

func (m *QueryPostsRequest) String() string

func (*QueryPostsRequest) Unmarshal

func (m *QueryPostsRequest) Unmarshal(dAtA []byte) error

func (*QueryPostsRequest) XXX_DiscardUnknown

func (m *QueryPostsRequest) XXX_DiscardUnknown()

func (*QueryPostsRequest) XXX_Marshal

func (m *QueryPostsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPostsRequest) XXX_Merge

func (m *QueryPostsRequest) XXX_Merge(src proto.Message)

func (*QueryPostsRequest) XXX_Size

func (m *QueryPostsRequest) XXX_Size() int

func (*QueryPostsRequest) XXX_Unmarshal

func (m *QueryPostsRequest) XXX_Unmarshal(b []byte) error

type QueryPostsResponse

type QueryPostsResponse struct {
	Posts []Post `protobuf:"bytes,1,rep,name=posts,proto3" json:"posts"`
}

func (*QueryPostsResponse) Descriptor

func (*QueryPostsResponse) Descriptor() ([]byte, []int)

func (*QueryPostsResponse) GetPosts

func (m *QueryPostsResponse) GetPosts() []Post

func (*QueryPostsResponse) Marshal

func (m *QueryPostsResponse) Marshal() (dAtA []byte, err error)

func (*QueryPostsResponse) MarshalTo

func (m *QueryPostsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryPostsResponse) MarshalToSizedBuffer

func (m *QueryPostsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPostsResponse) ProtoMessage

func (*QueryPostsResponse) ProtoMessage()

func (*QueryPostsResponse) Reset

func (m *QueryPostsResponse) Reset()

func (*QueryPostsResponse) Size

func (m *QueryPostsResponse) Size() (n int)

func (*QueryPostsResponse) String

func (m *QueryPostsResponse) String() string

func (*QueryPostsResponse) Unmarshal

func (m *QueryPostsResponse) Unmarshal(dAtA []byte) error

func (*QueryPostsResponse) XXX_DiscardUnknown

func (m *QueryPostsResponse) XXX_DiscardUnknown()

func (*QueryPostsResponse) XXX_Marshal

func (m *QueryPostsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPostsResponse) XXX_Merge

func (m *QueryPostsResponse) XXX_Merge(src proto.Message)

func (*QueryPostsResponse) XXX_Size

func (m *QueryPostsResponse) XXX_Size() int

func (*QueryPostsResponse) XXX_Unmarshal

func (m *QueryPostsResponse) XXX_Unmarshal(b []byte) error

type QueryServer

QueryServer is the server API for Query service.

type QueryUpvotesRequest

type QueryUpvotesRequest struct {
	VendorId uint32 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id,omitempty"`
	PostId   string `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
}

func (*QueryUpvotesRequest) Descriptor

func (*QueryUpvotesRequest) Descriptor() ([]byte, []int)

func (*QueryUpvotesRequest) Marshal

func (m *QueryUpvotesRequest) Marshal() (dAtA []byte, err error)

func (*QueryUpvotesRequest) MarshalTo

func (m *QueryUpvotesRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryUpvotesRequest) MarshalToSizedBuffer

func (m *QueryUpvotesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryUpvotesRequest) ProtoMessage

func (*QueryUpvotesRequest) ProtoMessage()

func (*QueryUpvotesRequest) Reset

func (m *QueryUpvotesRequest) Reset()

func (*QueryUpvotesRequest) Size

func (m *QueryUpvotesRequest) Size() (n int)

func (*QueryUpvotesRequest) String

func (m *QueryUpvotesRequest) String() string

func (*QueryUpvotesRequest) Unmarshal

func (m *QueryUpvotesRequest) Unmarshal(dAtA []byte) error

func (*QueryUpvotesRequest) XXX_DiscardUnknown

func (m *QueryUpvotesRequest) XXX_DiscardUnknown()

func (*QueryUpvotesRequest) XXX_Marshal

func (m *QueryUpvotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryUpvotesRequest) XXX_Merge

func (m *QueryUpvotesRequest) XXX_Merge(src proto.Message)

func (*QueryUpvotesRequest) XXX_Size

func (m *QueryUpvotesRequest) XXX_Size() int

func (*QueryUpvotesRequest) XXX_Unmarshal

func (m *QueryUpvotesRequest) XXX_Unmarshal(b []byte) error

type QueryUpvotesResponse

type QueryUpvotesResponse struct {
	Upvotes []Upvote `protobuf:"bytes,1,rep,name=upvotes,proto3" json:"upvotes"`
}

func (*QueryUpvotesResponse) Descriptor

func (*QueryUpvotesResponse) Descriptor() ([]byte, []int)

func (*QueryUpvotesResponse) GetUpvotes

func (m *QueryUpvotesResponse) GetUpvotes() []Upvote

func (*QueryUpvotesResponse) Marshal

func (m *QueryUpvotesResponse) Marshal() (dAtA []byte, err error)

func (*QueryUpvotesResponse) MarshalTo

func (m *QueryUpvotesResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryUpvotesResponse) MarshalToSizedBuffer

func (m *QueryUpvotesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryUpvotesResponse) ProtoMessage

func (*QueryUpvotesResponse) ProtoMessage()

func (*QueryUpvotesResponse) Reset

func (m *QueryUpvotesResponse) Reset()

func (*QueryUpvotesResponse) Size

func (m *QueryUpvotesResponse) Size() (n int)

func (*QueryUpvotesResponse) String

func (m *QueryUpvotesResponse) String() string

func (*QueryUpvotesResponse) Unmarshal

func (m *QueryUpvotesResponse) Unmarshal(dAtA []byte) error

func (*QueryUpvotesResponse) XXX_DiscardUnknown

func (m *QueryUpvotesResponse) XXX_DiscardUnknown()

func (*QueryUpvotesResponse) XXX_Marshal

func (m *QueryUpvotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryUpvotesResponse) XXX_Merge

func (m *QueryUpvotesResponse) XXX_Merge(src proto.Message)

func (*QueryUpvotesResponse) XXX_Size

func (m *QueryUpvotesResponse) XXX_Size() int

func (*QueryUpvotesResponse) XXX_Unmarshal

func (m *QueryUpvotesResponse) XXX_Unmarshal(b []byte) error

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Post

func (*UnimplementedMsgServer) Upvote

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) Post

func (*UnimplementedQueryServer) Posts

func (*UnimplementedQueryServer) Upvotes

type Upvote

type Upvote struct {
	VendorID      uint32     `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"`
	PostID        PostID     `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3,customtype=PostID" json:"post_id" yaml:"post_id"`
	Curator       string     `protobuf:"bytes,3,opt,name=curator,proto3" json:"curator,omitempty" yaml:"curator"`
	RewardAccount string     `protobuf:"bytes,4,opt,name=reward_account,json=rewardAccount,proto3" json:"reward_account,omitempty" yaml:"reward_account"`
	VoteAmount    types.Coin `protobuf:"bytes,5,opt,name=vote_amount,json=voteAmount,proto3" json:"vote_amount"`
	CuratedTime   time.Time  `protobuf:"bytes,6,opt,name=curated_time,json=curatedTime,proto3,stdtime" json:"curated_time" yaml:"curated_time"`
}

func NewUpvote

func NewUpvote(
	vendorID uint32, postID PostID, curator, rewardAccount sdk.AccAddress,
	voteAmount sdk.Coin, curatedTime time.Time) Upvote

NewUpvote fills and Upvote struct

func (*Upvote) Descriptor

func (*Upvote) Descriptor() ([]byte, []int)

func (*Upvote) GetCuratedTime

func (m *Upvote) GetCuratedTime() time.Time

func (*Upvote) GetCurator

func (m *Upvote) GetCurator() string

func (*Upvote) GetRewardAccount

func (m *Upvote) GetRewardAccount() string

func (*Upvote) GetVendorID

func (m *Upvote) GetVendorID() uint32

func (*Upvote) GetVoteAmount

func (m *Upvote) GetVoteAmount() types.Coin

func (*Upvote) Marshal

func (m *Upvote) Marshal() (dAtA []byte, err error)

func (*Upvote) MarshalTo

func (m *Upvote) MarshalTo(dAtA []byte) (int, error)

func (*Upvote) MarshalToSizedBuffer

func (m *Upvote) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Upvote) ProtoMessage

func (*Upvote) ProtoMessage()

func (*Upvote) Reset

func (m *Upvote) Reset()

func (*Upvote) Size

func (m *Upvote) Size() (n int)

func (*Upvote) String

func (m *Upvote) String() string

func (*Upvote) Unmarshal

func (m *Upvote) Unmarshal(dAtA []byte) error

func (*Upvote) XXX_DiscardUnknown

func (m *Upvote) XXX_DiscardUnknown()

func (*Upvote) XXX_Marshal

func (m *Upvote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Upvote) XXX_Merge

func (m *Upvote) XXX_Merge(src proto.Message)

func (*Upvote) XXX_Size

func (m *Upvote) XXX_Size() int

func (*Upvote) XXX_Unmarshal

func (m *Upvote) XXX_Unmarshal(b []byte) error

type Upvotes

type Upvotes []Upvote

Upvotes is a collection of Upvote objects

type VPPair

type VPPair struct {
	VendorID uint32 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"`
	PostID   PostID `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3,customtype=PostID" json:"post_id" yaml:"post_id"`
}

VPPair is struct that just has a vendor_id, post_id pair with no other data. It is intended to be used as a marshalable pointer. For example, a VPPair can be used to construct the key to getting an Upvote from state.

func (*VPPair) Descriptor

func (*VPPair) Descriptor() ([]byte, []int)

func (*VPPair) Equal

func (this *VPPair) Equal(that interface{}) bool

func (*VPPair) GetVendorID

func (m *VPPair) GetVendorID() uint32

func (*VPPair) Marshal

func (m *VPPair) Marshal() (dAtA []byte, err error)

func (*VPPair) MarshalTo

func (m *VPPair) MarshalTo(dAtA []byte) (int, error)

func (*VPPair) MarshalToSizedBuffer

func (m *VPPair) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*VPPair) ProtoMessage

func (*VPPair) ProtoMessage()

func (*VPPair) Reset

func (m *VPPair) Reset()

func (*VPPair) Size

func (m *VPPair) Size() (n int)

func (*VPPair) String

func (m *VPPair) String() string

func (*VPPair) Unmarshal

func (m *VPPair) Unmarshal(dAtA []byte) error

func (*VPPair) XXX_DiscardUnknown

func (m *VPPair) XXX_DiscardUnknown()

func (*VPPair) XXX_Marshal

func (m *VPPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VPPair) XXX_Merge

func (m *VPPair) XXX_Merge(src proto.Message)

func (*VPPair) XXX_Size

func (m *VPPair) XXX_Size() int

func (*VPPair) XXX_Unmarshal

func (m *VPPair) XXX_Unmarshal(b []byte) error

type VPPairs

type VPPairs struct {
	Pairs []VPPair `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs"`
}

VPPairs defines an array of VPPair objects.

func (*VPPairs) Descriptor

func (*VPPairs) Descriptor() ([]byte, []int)

func (*VPPairs) GetPairs

func (m *VPPairs) GetPairs() []VPPair

func (*VPPairs) Marshal

func (m *VPPairs) Marshal() (dAtA []byte, err error)

func (*VPPairs) MarshalTo

func (m *VPPairs) MarshalTo(dAtA []byte) (int, error)

func (*VPPairs) MarshalToSizedBuffer

func (m *VPPairs) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*VPPairs) ProtoMessage

func (*VPPairs) ProtoMessage()

func (*VPPairs) Reset

func (m *VPPairs) Reset()

func (*VPPairs) Size

func (m *VPPairs) Size() (n int)

func (*VPPairs) String

func (m *VPPairs) String() string

func (*VPPairs) Unmarshal

func (m *VPPairs) Unmarshal(dAtA []byte) error

func (*VPPairs) XXX_DiscardUnknown

func (m *VPPairs) XXX_DiscardUnknown()

func (*VPPairs) XXX_Marshal

func (m *VPPairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VPPairs) XXX_Merge

func (m *VPPairs) XXX_Merge(src proto.Message)

func (*VPPairs) XXX_Size

func (m *VPPairs) XXX_Size() int

func (*VPPairs) XXX_Unmarshal

func (m *VPPairs) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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