Skip to main content
Version: v2.0_alpha

MockTally

returnValue

bool returnValue

flipReturnValue

function flipReturnValue() external

Flip the return value

used for mock testing

verifyPerVOSpentVoiceCredits

function verifyPerVOSpentVoiceCredits(uint256 _voteOptionIndex, uint256 _spent, uint256[][] _spentProof, uint256 _spentSalt, uint8 _voteOptionTreeDepth, uint256 _spentVoiceCreditsHash, uint256 _resultCommitment) external view returns (bool)

Return Values

NameTypeDescription
[0]boolisValid Whether the provided proof is valid

verifySpentVoiceCredits

function verifySpentVoiceCredits(uint256 _totalSpent, uint256 _totalSpentSalt, uint256 _resultCommitment, uint256 _perVOSpentVoiceCreditsHash) external view returns (bool)

Verify the number of spent voice credits from the tally.json

Parameters

NameTypeDescription
_totalSpentuint256spent field retrieved in the totalSpentVoiceCredits object
_totalSpentSaltuint256the corresponding salt in the totalSpentVoiceCredit object
_resultCommitmentuint256hashLeftRight(merkle root of the results.tally, results.salt) in tally.json file
_perVOSpentVoiceCreditsHashuint256only for QV - hashLeftRight(merkle root of the no spent voice credits, salt)