Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Delegate indicates the vote content is for vote producer. Delegate VoteType = 0x00 // CRC indicates the vote content is for vote CRC. CRC VoteType = 0x01 // VoteProducerVersion indicates the output version only support delegate // vote type, and not support different votes for different candidates. VoteProducerVersion = 0x00 // VoteProducerAndCRVersion indicates the output version support delegate // and CRC vote type, and support different votes for different candidates. VoteProducerAndCRVersion = 0x01 )
View Source
const (
MaxVoteProducersPerTransaction = 36
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CandidateVotes ¶ added in v0.4.0
CandidateVotes defines the voting information for individual candidates.
func (*CandidateVotes) Deserialize ¶ added in v0.4.0
func (cv *CandidateVotes) Deserialize(r io.Reader, version byte) error
func (*CandidateVotes) Serialize ¶ added in v0.4.0
func (cv *CandidateVotes) Serialize(w io.Writer, version byte) error
func (*CandidateVotes) String ¶ added in v0.4.0
func (cv *CandidateVotes) String() string
type DefaultOutput ¶
type DefaultOutput struct { }
func (*DefaultOutput) Data ¶
func (o *DefaultOutput) Data() []byte
func (*DefaultOutput) Deserialize ¶
func (o *DefaultOutput) Deserialize(r io.Reader) error
func (*DefaultOutput) GetVersion ¶
func (o *DefaultOutput) GetVersion() byte
func (*DefaultOutput) Validate ¶
func (o *DefaultOutput) Validate() error
type Mapping ¶ added in v0.3.0
type Mapping struct { // Version indicates the version of Mapping payload. Version byte // OwnerPublicKey is the owner public key of the main chain producer. OwnerPublicKey []byte // SideProducerID indicates a piece of data represent the identity of the // side chain producer, whether it is a public key or address etc. SideProducerID []byte // Signature represents the signature of the mapping payload content. Signature []byte }
Mapping output payload is defined to mapping the main chain producer's owner public key to a side chain producer.
func (*Mapping) GetVersion ¶ added in v0.3.0
type VoteContent ¶
type VoteContent struct { VoteType VoteType CandidateVotes []CandidateVotes }
VoteContent defines the vote type and vote information of candidates.
func (*VoteContent) Deserialize ¶
func (vc *VoteContent) Deserialize(r io.Reader, version byte) error
func (VoteContent) String ¶
func (vc VoteContent) String() string
type VoteOutput ¶
type VoteOutput struct { Version byte Contents []VoteContent }
VoteOutput defines the output payload for vote.
func (*VoteOutput) Data ¶
func (o *VoteOutput) Data() []byte
func (*VoteOutput) Deserialize ¶
func (o *VoteOutput) Deserialize(r io.Reader) error
func (*VoteOutput) GetVersion ¶
func (o *VoteOutput) GetVersion() byte
func (VoteOutput) String ¶
func (o VoteOutput) String() string
func (*VoteOutput) Validate ¶
func (o *VoteOutput) Validate() error
Click to show internal directories.
Click to hide internal directories.