Documentation ¶
Index ¶
- Constants
- func Verify(vkString string, proof *goSnarkVerifier.CircomProof, publicSignal []string) bool
- func VerifyByFile(vkPath string, pfPath string) bool
- type IdentityPool
- func (i *IdentityPool) GetAllIds() []*IdPathElement
- func (i *IdentityPool) GetIdentityTreePath(value *IdPathElement) ([]*IdPathElement, []int, *IdPathElement)
- func (i *IdentityPool) GetIndex(value *IdPathElement) int
- func (i *IdentityPool) HasRegistered(idc *IdPathElement) bool
- func (i *IdentityPool) InsertIdc(idCommitment *IdPathElement) (int, error)
- func (i *IdentityPool) IsMember(root *IdPathElement) bool
- func (i *IdentityPool) OverwriteIdElements(commitmentSet []*IdPathElement) (int, error)
- func (i *IdentityPool) Update(index uint, oldIDCommitment, newIDCommitment *IdPathElement) error
- type Proposal
- func (p *Proposal) Close(idx int)
- func (p *Proposal) GetBallots() ba.Map
- func (p *Proposal) GetCurrentIdex() int
- func (p *Proposal) GetVotes(idx int) (yes, no int)
- func (p *Proposal) HasProposal(q string) int
- func (p *Proposal) HasProposalByHash(hash *big.Int) int
- func (p *Proposal) InsertBallot(ballot *ba.Ballot) error
- func (p *Proposal) ProposeSubject(subHash subject.HashHex) int
- func (p *Proposal) Remove(idx int)
- func (p *Proposal) VoteWithProof(ballot *ba.Ballot, vkString string) error
- type Voter
- func (v *Voter) GetAllIdentities() []id.Identity
- func (v *Voter) GetBallotMap() ba.Map
- func (v *Voter) GetIdentityIndex(identity id.Identity) int
- func (v *Voter) GetIdentityPath(identity id.Identity) ([]*id.IdPathElement, []int, *id.IdPathElement, error)
- func (v *Voter) GetIdentitySub() *pubsub.Subscription
- func (v *Voter) GetSubject() *subject.Subject
- func (v *Voter) GetVoteSub() *pubsub.Subscription
- func (v *Voter) InsertIdentity(identity *id.Identity) (int, error)
- func (v *Voter) Join(identity *id.Identity) error
- func (v *Voter) Open() (yes, no int)
- func (v *Voter) OverwriteIds(identities []*id.Identity) (int, error)
- func (v *Voter) Propose() int
- func (v *Voter) Vote(ballot *ba.Ballot, silent bool) error
Constants ¶
const HASH_NO = "85131057757245807317576516368191972321038229705283732634690444270750521936266"
const HASH_YES = "43379584054787486383572605962602545002668015983485933488536749112829893476306"
const TREE_LEVEL uint8 = 10
Variables ¶
This section is empty.
Functions ¶
func Verify ¶
func Verify(vkString string, proof *goSnarkVerifier.CircomProof, publicSignal []string) bool
Verify : verify proof
func VerifyByFile ¶
VerifyByFile : verify proof
Types ¶
type IdentityPool ¶
type IdentityPool struct {
// contains filtered or unexported fields
}
IdentityPool ...
func NewIdentityPoolWithTreeLevel ¶
func NewIdentityPoolWithTreeLevel(treeLevel uint8) (*IdentityPool, error)
NewIdentityPoolWithTreeLevel ...
func (*IdentityPool) GetIdentityTreePath ¶
func (i *IdentityPool) GetIdentityTreePath(value *IdPathElement) ([]*IdPathElement, []int, *IdPathElement)
GetIdentityTreePath .
func (*IdentityPool) GetIndex ¶
func (i *IdentityPool) GetIndex(value *IdPathElement) int
GetIndex .
func (*IdentityPool) HasRegistered ¶
func (i *IdentityPool) HasRegistered(idc *IdPathElement) bool
HasRegistered .
func (*IdentityPool) InsertIdc ¶
func (i *IdentityPool) InsertIdc(idCommitment *IdPathElement) (int, error)
InsertIdc : register id
func (*IdentityPool) IsMember ¶
func (i *IdentityPool) IsMember(root *IdPathElement) bool
IsMember : check if the merkle root is in the root list or not
func (*IdentityPool) OverwriteIdElements ¶
func (i *IdentityPool) OverwriteIdElements(commitmentSet []*IdPathElement) (int, error)
OverwriteIds . return total len and error
func (*IdentityPool) Update ¶
func (i *IdentityPool) Update(index uint, oldIDCommitment, newIDCommitment *IdPathElement) error
Update : update id
type Proposal ¶
type Proposal struct {
// contains filtered or unexported fields
}
Proposal ... TODO: Rename
func (*Proposal) GetBallots ¶
func (*Proposal) GetCurrentIdex ¶
GetCurrentIdex : get current index of whole questions
func (*Proposal) HasProposal ¶
HasProposal : check proposal exists or not return : -1, not exists, proposal index otherwise
func (*Proposal) HasProposalByHash ¶
HasProposalByHash : check proposal exists or not return : -1, not exists, proposal index otherwise
func (*Proposal) InsertBallot ¶
InsertBallot ...
func (*Proposal) ProposeSubject ¶
Propose : propose the hash of a question
type Voter ¶
type Voter struct { *IdentityPool *Proposal *localContext.Context // contains filtered or unexported fields }
Voter .
func NewVoter ¶
func NewVoter( subject *subject.Subject, ps *pubsub.PubSub, lc *localContext.Context, verificationKey string, ) (*Voter, error)
NewVoter ...
func (*Voter) GetAllIdentities ¶
GetAllIdentities .
func (*Voter) GetIdentityIndex ¶
GetIdentityIndex .
func (*Voter) GetIdentityPath ¶
func (v *Voter) GetIdentityPath(identity id.Identity) ([]*id.IdPathElement, []int, *id.IdPathElement, error)
GetIdentityPath .
func (*Voter) GetIdentitySub ¶
func (v *Voter) GetIdentitySub() *pubsub.Subscription
GetIdentitySub ...
func (*Voter) InsertIdentity ¶
InsertIdentity .
func (*Voter) OverwriteIds ¶
OverwriteIds .