Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
*storage.Cyclic[uint32, *Round]
// Channel for actions created by voting.
Out chan *types.Action
// contains filtered or unexported fields
}
Storage uses a cyclic storage that host voting processes in rounds - one round for each signingPolicy. Round for signing policy ID is stored at ID%size. When a new round is created, the old one at its place is overwritten.
Meta provides the meta data for voting processes.
func (*Storage) AddVote ¶
func (s *Storage) AddVote(data *instruction.Data, signer common.Address, signature []byte) (*voting.Receipt, error)
AddVote adds vote to a correct vote box in a correct round and returns a receipt. If a round does not exits, an error is returned. If a VoteBox does not exist yet, a new VoteBox is created if the proposer is not limited.
func (*Storage) StoreNewRound ¶
func (s *Storage) StoreNewRound(policy *policy.SigningPolicy)
StoreNewRound creates a round for signing policy and stores it. This in process overwrites an old round in the place of the new one. If a round is already created nothing happens.