You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ballot
when the contract is deployed
✔ has the provided proposals (13702ms)
✔ has zero votes for all proposals
✔ sets the deployer address as chairperson
✔ sets the voting weight for the chairperson as 1
when the chairperson interacts with the giveRightToVote function
1) gives right to vote for another address
2) cannot give right to vote for someone that has voted
3) cannot give right to vote for someone that already has voting rights
when the voter interacts with the vote function
4) should register the vote
when the voter interacts with the delegate function
5) should transfer voting power
when an account other than the chairperson interacts with giveRightToVote
6) should revert
when an account without right to vote interacts with the vote function
7) should revert
when someone interacts with the winningProposal function before any votes are cast
✔ should return 0
when someone interacts with the winnerName function before any votes are cast
✔ should return name of proposal 0
Lock
Deployment
✔ Should set the right unlockTime (207ms)
✔ Should set the right owner
✔ Should receive and store the funds to lock
✔ Should fail if the unlockTime is not in the future (903ms)
Withdrawals
Validations
✔ Should revert with the right error if called too soon
✔ Should revert with the right error if called from another account
✔ Shouldn't fail if the unlockTime has arrived and the owner calls it (123ms)
Events
✔ Should emit an event on withdrawals
14 passing (17s)
7 failing
Ballot
when the chairperson interacts with the giveRightToVote function
gives right to vote for another address:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:52:40)
Ballot
when the chairperson interacts with the giveRightToVote function
cannot give right to vote for someone that has voted:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:59:40)
Ballot
when the chairperson interacts with the giveRightToVote function
cannot give right to vote for someone that already has voting rights:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:66:40)
Ballot
when the voter interacts with the vote function
should register the vote:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:74:40)
Ballot
when the voter interacts with the delegate function
should transfer voting power:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:84:40)
Ballot
when an account other than the chairperson interacts with giveRightToVote
should revert:
TypeError: ballotContract.connect is not a function
at Context. (test/Ballot.ts:94:41)
Ballot
when an account without right to vote interacts with the vote function
should revert:
TypeError: ballotContract.connect is not a function
at Context. (test/Ballot.ts:101:41)
The text was updated successfully, but these errors were encountered:
npx hardhat test
Ballot
when the contract is deployed
✔ has the provided proposals (13702ms)
✔ has zero votes for all proposals
✔ sets the deployer address as chairperson
✔ sets the voting weight for the chairperson as 1
when the chairperson interacts with the giveRightToVote function
1) gives right to vote for another address
2) cannot give right to vote for someone that has voted
3) cannot give right to vote for someone that already has voting rights
when the voter interacts with the vote function
4) should register the vote
when the voter interacts with the delegate function
5) should transfer voting power
when an account other than the chairperson interacts with giveRightToVote
6) should revert
when an account without right to vote interacts with the vote function
7) should revert
when someone interacts with the winningProposal function before any votes are cast
✔ should return 0
when someone interacts with the winnerName function before any votes are cast
✔ should return name of proposal 0
Lock
Deployment
✔ Should set the right unlockTime (207ms)
✔ Should set the right owner
✔ Should receive and store the funds to lock
✔ Should fail if the unlockTime is not in the future (903ms)
Withdrawals
Validations
✔ Should revert with the right error if called too soon
✔ Should revert with the right error if called from another account
✔ Shouldn't fail if the unlockTime has arrived and the owner calls it (123ms)
Events
✔ Should emit an event on withdrawals
14 passing (17s)
7 failing
when the chairperson interacts with the giveRightToVote function
gives right to vote for another address:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:52:40)
when the chairperson interacts with the giveRightToVote function
cannot give right to vote for someone that has voted:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:59:40)
when the chairperson interacts with the giveRightToVote function
cannot give right to vote for someone that already has voting rights:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:66:40)
when the voter interacts with the vote function
should register the vote:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:74:40)
when the voter interacts with the delegate function
should transfer voting power:
AbiEncodingLengthMismatchError: ABI encoding params/values length mismatch.
Expected length (params): 1
Given length (values): 0
Version: 2.19.6
at encodeAbiParameters (node_modules/viem/utils/abi/encodeAbiParameters.ts:92:11)
at encodeFunctionData (node_modules/viem/utils/abi/encodeFunctionData.ts:93:28)
at writeContract (node_modules/viem/actions/wallet/writeContract.ts:161:34)
at writeContract (node_modules/viem/clients/decorators/wallet.ts:713:43)
at Proxy. (node_modules/viem/actions/getContract.ts:726:16)
at Context. (test/Ballot.ts:84:40)
Ballot
when an account other than the chairperson interacts with giveRightToVote
should revert:
TypeError: ballotContract.connect is not a function
at Context. (test/Ballot.ts:94:41)
Ballot
when an account without right to vote interacts with the vote function
should revert:
TypeError: ballotContract.connect is not a function
at Context. (test/Ballot.ts:101:41)
The text was updated successfully, but these errors were encountered: