types

package
v0.0.0-...-ccbdc65 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BulletinBoardCodespace sdk.CodespaceType = BulletinBoardModuleName

	InvalidBallot     sdk.CodeType = 101
	InvalidCredential sdk.CodeType = 201
)
View Source
const (
	BulletinBoardModuleName = "pbb"
	VoterCredentialStoreKey = "pbb.voterCredentials"
	BallotStoreKey          = "pbb.ballots"
	PolynomialStoreKey      = "pbb.polynomial"
)
View Source
const DefaultParamSpace = BulletinBoardModuleName

Variables

View Source
var (
	// Parameter keys
	CommPKey         = []byte("CommP")
	CommQKey         = []byte("CommQ")
	HKey             = []byte("HHat")
	SecurityParamKey = []byte("SecurityParam")
)
View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module

Functions

func ErrInvalidBallot

func ErrInvalidBallot(msg string) sdk.Error

func ParamKeyTable

func ParamKeyTable() subspace.KeyTable

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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"`
}

func NewBallot

func NewBallot(c *big.Int, d *big.Int, v string, uHat *big.Int,
	proof1 crypto.PolyEvalProof, proof2 crypto.DdLogProof, proof3 crypto.PreimageEqualityProof) Ballot

func (Ballot) String

func (b Ballot) String() string

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 DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

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.

func (Params) String

func (p Params) String() string

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

Jump to

Keyboard shortcuts

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