vote

package
v0.5.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VoteSizeLimit is the maximum size of vote allowed
	VoteSizeLimit = 278

	// ProtocolID is the protocol ID
	// TODO: it works only for one instance per protocol definition now
	ProtocolID = "vote"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

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

Protocol defines the protocol of handling votes

func NewProtocol

func NewProtocol(cm protocol.ChainManager) *Protocol

NewProtocol instantiates the protocol of vote

func (*Protocol) Handle

Handle handles a vote

func (*Protocol) Initialize

func (p *Protocol) Initialize(ctx context.Context, sm protocol.StateManager, addrs []address.Address) error

Initialize initializes the rewarding protocol by setting the original admin, block and epoch reward

func (*Protocol) ReadState

func (p *Protocol) ReadState(context.Context, protocol.StateManager, []byte, ...[]byte) ([]byte, error)

ReadState read the state on blockchain via protocol

func (*Protocol) Validate

func (p *Protocol) Validate(ctx context.Context, act action.Action) error

Validate validates a vote

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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