Documentation ¶
Index ¶
- Constants
- type Protocol
- func (p *Protocol) Handle(ctx context.Context, act action.Action, sm protocol.StateManager) (*action.Receipt, error)
- func (p *Protocol) Initialize(ctx context.Context, sm protocol.StateManager, addrs []string) error
- func (p *Protocol) ReadState(context.Context, protocol.StateManager, []byte, ...[]byte) ([]byte, error)
- func (p *Protocol) Validate(ctx context.Context, act action.Action) error
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 ¶
func (p *Protocol) Handle(ctx context.Context, act action.Action, sm protocol.StateManager) (*action.Receipt, error)
Handle handles a vote
func (*Protocol) Initialize ¶
Initialize initializes the rewarding protocol by setting the original admin, block and epoch reward
Click to show internal directories.
Click to hide internal directories.