outputpayload

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 6 Imported by: 0

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

type CandidateVotes struct {
	Candidate []byte
	Votes     common.Fixed64
}

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) Serialize

func (o *DefaultOutput) Serialize(w io.Writer) error

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) Data added in v0.3.0

func (m *Mapping) Data() []byte

func (*Mapping) Deserialize added in v0.3.0

func (m *Mapping) Deserialize(r io.Reader) error

func (*Mapping) GetVersion added in v0.3.0

func (m *Mapping) GetVersion() byte

func (*Mapping) Serialize added in v0.3.0

func (m *Mapping) Serialize(w io.Writer) error

func (*Mapping) Validate added in v0.3.0

func (m *Mapping) Validate() error

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) Serialize

func (vc *VoteContent) Serialize(w io.Writer, 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) Serialize

func (o *VoteOutput) Serialize(w io.Writer) error

func (VoteOutput) String

func (o VoteOutput) String() string

func (*VoteOutput) Validate

func (o *VoteOutput) Validate() error

type VoteType

type VoteType byte

VoteType indicates the type of vote content.

Jump to

Keyboard shortcuts

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