keeper

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryBallots              = "ballots"
	QueryParameters           = "parameters"
	QueryVoterCredentials     = "voterCredentials"
	QueryCredentialPolynomial = "credentialPolynomial"
)

Query endpoints supported by the pbb Querier

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper BulletinBoardKeeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type BulletinBoardKeeper

type BulletinBoardKeeper struct {
	// contains filtered or unexported fields
}

BulletinBoardKeeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine

func NewBulletinBoardKeeper

func NewBulletinBoardKeeper(credentialStoreKey sdk.StoreKey, ballotStoreKey sdk.StoreKey,
	polyStoreKey sdk.StoreKey, cdc *codec.Codec, paramStore subspace.Subspace) BulletinBoardKeeper

NewBulletinBoardKeeper creates new instances of the pbb BulletinBoardKeeper

func (BulletinBoardKeeper) GetBallot

func (k BulletinBoardKeeper) GetBallot(ctx sdk.Context, electionCredential big.Int) *types.Ballot

func (BulletinBoardKeeper) GetBallotsIterator

func (k BulletinBoardKeeper) GetBallotsIterator(ctx sdk.Context) sdk.Iterator

func (BulletinBoardKeeper) GetCredentialPolynomial

func (k BulletinBoardKeeper) GetCredentialPolynomial(ctx sdk.Context) crypto.Polynomial

func (BulletinBoardKeeper) GetParams

func (k BulletinBoardKeeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams gets the bulletin board module's parameters.

func (BulletinBoardKeeper) GetVoterCredentialsIterator

func (k BulletinBoardKeeper) GetVoterCredentialsIterator(ctx sdk.Context) sdk.Iterator

func (BulletinBoardKeeper) HasElectionCredential

func (k BulletinBoardKeeper) HasElectionCredential(ctx sdk.Context, uHat *big.Int) bool

func (BulletinBoardKeeper) HasVoterCredential

func (k BulletinBoardKeeper) HasVoterCredential(ctx sdk.Context, credential big.Int) bool

func (BulletinBoardKeeper) SetParams

func (k BulletinBoardKeeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the auth module's parameters.

func (BulletinBoardKeeper) StoreBallot

func (k BulletinBoardKeeper) StoreBallot(ctx sdk.Context, b types.Ballot) error

func (BulletinBoardKeeper) StoreVoterCredential

func (k BulletinBoardKeeper) StoreVoterCredential(ctx sdk.Context, credential crypto.Int) error

StoreVoterCredential stores the given voter credential in the credentials KV store and updates the credentials polynomial, i.e includes the credential in the polynomial. Throws an error if the credential is already in the store.

Jump to

Keyboard shortcuts

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