Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ContractName is the name of the contract. ContractName = "go.dedis.ch/dela.Evoting" // CmdArg is the argument's name to indicate the kind of command we want to // run on the contract. Should be one of the Command type. CmdArg = "evoting:command" // FormArg is the key at which the form argument is stored in the // transaction. The content is defined by the type of command. FormArg = "evoting:arg" )
View Source
const ( // FormsMetadataKey is the key at which form metadata are saved in // the storage. FormsMetadataKey = "FormsMetadataKey" )
Variables ¶
View Source
var ( PromFormStatus = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "dvoting_status", Help: "status of form", }, []string{"form"}, ) PromFormBallots = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "dvoting_ballots_total", Help: "number of cast ballots", }, []string{"form"}, ) PromFormShufflingInstances = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "dvoting_shufflings_total", Help: "number of shuffling instances", }, []string{"form"}, ) Name: "dvoting_pubshares_total", Help: "published public shares", }, []string{"form"}, ) PromFormDkgStatus = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "dvoting_dkg_status", Help: "status of distributed key generator", }, []string{"form"}, ) )
Functions ¶
func NewCreds ¶
func NewCreds(id []byte) access.Credential
NewCreds creates new credentials for a evoting contract execution. We might want to use in the future a separate credential for each command.
func RegisterContract ¶
RegisterContract registers the value contract to the given execution service.
Types ¶
type Command ¶
type Command string
Command defines a type of command for the value contract
const ( // CmdCreateForm is the command to create a form CmdCreateForm Command = "CREATE_FORM" // CmdOpenForm is the command to open a form CmdOpenForm Command = "OPEN_FORM" // CmdCastVote is the command to cast a vote CmdCastVote Command = "CAST_VOTE" // CmdCloseForm is the command to close a form CmdCloseForm Command = "CLOSE_FORM" // CmdShuffleBallots is the command to shuffle ballots CmdShuffleBallots Command = "SHUFFLE_BALLOTS" CmdRegisterPubShares Command = "REGISTER_PUB_SHARES" CmdCombineShares Command = "COMBINE_SHARES" // CmdCancelForm is the command to cancel a form CmdCancelForm Command = "CANCEL_FORM" // CmdDeleteForm is the command to delete a form CmdDeleteForm Command = "DELETE_FORM" )
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
Contract is a smart contract that allows one to execute evoting commands
- implements native.Contract
type SemiRandomStream ¶
type SemiRandomStream struct {
// contains filtered or unexported fields
}
SemiRandomStream implements cipher.Stream
func NewSemiRandomStream ¶
func NewSemiRandomStream(seed []byte) (SemiRandomStream, error)
NewSemiRandomStream returns a new initialized semi-random struct based on math.Rand. This random stream is not cryptographically safe.
- implements cipher.Stream
func (SemiRandomStream) XORKeyStream ¶
func (s SemiRandomStream) XORKeyStream(dst, src []byte)
XORKeyStream implements cipher.Stream
Click to show internal directories.
Click to hide internal directories.