Documentation ¶
Index ¶
Constants ¶
const ( BulletinBoardCodespace sdk.CodespaceType = BulletinBoardModuleName InvalidBallot sdk.CodeType = 101 InvalidCredential sdk.CodeType = 201 )
const ( BulletinBoardModuleName = "pbb" VoterCredentialStoreKey = "pbb.voterCredentials" BallotStoreKey = "pbb.ballots" PolynomialStoreKey = "pbb.polynomial" )
const DefaultParamSpace = BulletinBoardModuleName
Variables ¶
var ( // Parameter keys CommPKey = []byte("CommP") CommQKey = []byte("CommQ") HKey = []byte("HHat") SecurityParamKey = []byte("SecurityParam") )
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func ErrInvalidBallot ¶
func ParamKeyTable ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type Ballot ¶
type Ballot struct { C crypto.Int `json:"c"` // commitment to u, value in Gp D crypto.Int `json:"d"` // commitment to a and b, value in Gq V string `json:"v"` // vote UHat crypto.Int `json:"u_hat"` // election credential Proof1 crypto.PolyEvalProof `json:"p1"` Proof2 crypto.DdLogProof `json:"p2"` Proof3 crypto.PreimageEqualityProof `json:"p3"` }
type GenesisState ¶
type GenesisState struct {
Params Params `json:"params"`
}
func NewGenesisState ¶
func NewGenesisState(params Params) GenesisState
type MsgPutBallot ¶
type MsgPutBallot struct { Ballot Ballot Signer sdk.AccAddress `json:"signer"` }
MsgPutBallot defines the message for posting a ballot to the bulletin board.
func NewMsgPutBallot ¶
func NewMsgPutBallot(c *big.Int, d *big.Int, v string, uHat *big.Int, proof1 crypto.PolyEvalProof, proof2 crypto.DdLogProof, proof3 crypto.PreimageEqualityProof, signer sdk.AccAddress) MsgPutBallot
func (MsgPutBallot) GetSignBytes ¶
func (msg MsgPutBallot) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgPutBallot) GetSigners ¶
func (msg MsgPutBallot) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgPutBallot) Route ¶
func (msg MsgPutBallot) Route() string
Route returns the name of the module.
func (MsgPutBallot) Type ¶
func (msg MsgPutBallot) Type() string
Type returns the action of the message.
func (MsgPutBallot) ValidateBasic ¶
func (msg MsgPutBallot) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgPutVoterCredential ¶
type MsgPutVoterCredential struct { Credential crypto.Int `json:"u"` Signer sdk.AccAddress `json:"signer"` }
MsgPutBallot defines the message for posting a ballot to the bulletin board.
func NewMsgPutVoterCredential ¶
func NewMsgPutVoterCredential(credential crypto.Int, signer sdk.AccAddress) MsgPutVoterCredential
NewMsgPutBallot creates a new instance of the MsgPutBallot message.
func (MsgPutVoterCredential) GetSignBytes ¶
func (msg MsgPutVoterCredential) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgPutVoterCredential) GetSigners ¶
func (msg MsgPutVoterCredential) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgPutVoterCredential) Route ¶
func (msg MsgPutVoterCredential) Route() string
Route returns the name of the module.
func (MsgPutVoterCredential) Type ¶
func (msg MsgPutVoterCredential) Type() string
Type returns the action of the message.
func (MsgPutVoterCredential) ValidateBasic ¶
func (msg MsgPutVoterCredential) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type Params ¶
type Params struct { CommP crypto.PedersenCommitmentScheme `json:"comm_p"` CommQ crypto.PedersenCommitmentScheme `json:"comm_q"` HHat crypto.Int `json:"h"` // election generator SecurityParam int `json:"k"` }
Params implements the ParamSet interface
func NewParams ¶
func NewParams(commP crypto.PedersenCommitmentScheme, commQ crypto.PedersenCommitmentScheme, h *big.Int, securityParam int) Params
NewParams creates a new Params object which does not set the election generator by choice.
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() subspace.ParamSetPairs
ParamSetPairs returns all the key/value pairs pairs of the bulletin board module's parameters.
type QueryResVoterCredential ¶
type QueryResVoterCredential struct { Credential crypto.Int `json:"credential"` BlockHeight int64 `json:"block_height"` }
func (QueryResVoterCredential) String ¶
func (credential QueryResVoterCredential) String() string
type QueryResVoterCredentials ¶
type QueryResVoterCredentials []QueryResVoterCredential
func (QueryResVoterCredentials) String ¶
func (credentials QueryResVoterCredentials) String() string