Minimal Anti Collusion Infrastructure (MACI) v2.0.0-alpha / MaciState
Class: MaciState
A representation of the MACI contract.
Implements
IMaciState
Constructors
new MaciState()
new MaciState(
stateTreeDepth
):MaciState
Constructs a new MaciState object.
Parameters
• stateTreeDepth: number
The depth of the state tree.
Returns
Defined in
MaciState.ts:32
Properties
currentPollBeingProcessed?
optional
currentPollBeingProcessed:bigint
Defined in
MaciState.ts:26
numSignUps
numSignUps:
number
=0
Defined in
MaciState.ts:21
pollBeingProcessed?
optional
pollBeingProcessed:boolean
Defined in
MaciState.ts:24
polls
polls:
Map
<bigint
,Poll
>
Defined in
MaciState.ts:13
stateLeaves
stateLeaves:
StateLeaf
[] =[]
Defined in
MaciState.ts:16
stateTreeDepth
stateTreeDepth:
number
Defined in
MaciState.ts:19
Methods
copy()
copy():
MaciState
Create a deep copy of the MaciState object.
Returns
A new instance of the MaciState object with the same properties.
Implementation of
IMaciState.copy
Defined in
MaciState.ts:99
deployNullPoll()
deployNullPoll():
void
Deploy a null poll.
Returns
void
Implementation of
IMaciState.deployNullPoll
Defined in
MaciState.ts:91
deployPoll()
deployPoll(
pollEndTimestamp
,maxValues
,treeDepths
,messageBatchSize
,coordinatorKeypair
):bigint
Deploy a new poll with the given parameters.
Parameters
• pollEndTimestamp: bigint
The Unix timestamp at which the poll ends.
• maxValues: MaxValues
The maximum number of values for each vote option.
• treeDepths: TreeDepths
The depths of the tree.
• messageBatchSize: number
The batch size for processing messages.
• coordinatorKeypair: Keypair
The keypair of the MACI round coordinator.
Returns
bigint
The index of the newly deployed poll.
Implementation of
IMaciState.deployPoll
Defined in
MaciState.ts:65
equals()
equals(
m
):boolean
Check if the MaciState object is equal to another MaciState object.
Parameters
• m: MaciState
The MaciState object to compare.
Returns
boolean
True if the two MaciState objects are equal, false otherwise.
Implementation of
IMaciState.equals
Defined in
MaciState.ts:114
signUp()
signUp(
pubKey
,initialVoiceCreditBalance
,timestamp
):number
Sign up a user with the given public key, initial voice credit balance, and timestamp.
Parameters
• pubKey: PubKey
The public key of the user.
• initialVoiceCreditBalance: bigint
The initial voice credit balance of the user.
• timestamp: bigint
The timestamp of the sign-up.
Returns
number
The index of the newly signed-up user in the state tree.
Implementation of
IMaciState.signUp
Defined in
MaciState.ts:49
toJSON()
toJSON():
IJsonMaciState
Serialize the MaciState object to a JSON object.
Returns
A JSON object representing the MaciState object.
Implementation of
IMaciState.toJSON
Defined in
MaciState.ts:142
fromJSON()
static
fromJSON(json
):MaciState
Create a new MaciState object from a JSON object.
Parameters
• json: IJsonMaciState
The JSON object representing the MaciState object.
Returns
A new instance of the MaciState object with the properties from the JSON object.
Defined in
MaciState.ts:158