-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(contracts): cleanup unused scripts and organize ts code #909
Conversation
✅ Deploy Preview for maci-typedoc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
1e69f50
to
4eb8e72
Compare
549a95e
to
efe8d5f
Compare
Line 129 in efe8d5f
Should the contract here be changed to aqContract to keep consistence with other testFill functions?
|
maci/contracts/tests/AccQueue.test.ts Line 38 in efe8d5f
This has been tested in |
efe8d5f
to
abb90dd
Compare
Line 188 in efe8d5f
For me, I would expect this function testing if enqueueing leaves works well. Not sure why we need to insert another subtree? Isn't it testing two things? (The leaves could be successfully inserted, and if the tree is full, there will be another subtree) or actually they are the same thing? (please tell me if I understand wrong) |
3907102
to
e183411
Compare
Sure, changed that for all accQueue test functions |
Hold you thoughts on the tests, let's write everything that is not clear down so we can fix in another PR 🙂 |
e183411
to
282ff28
Compare
maci/contracts/tests/AccQueue.test.ts Line 467 in 282ff28
The test here is actually being tested also in the edge tests maci/contracts/tests/AccQueue.test.ts Line 207 in 282ff28
|
282ff28
to
724f18e
Compare
Some typos: maci/contracts/tests/Tally.test.ts Line 183 in 724f18e
should* maci/contracts/tests/Poll.test.ts Line 112 in 724f18e
should* again |
maci/contracts/tests/Tally.test.ts Line 129 in 724f18e
Just curious that should we make arguments in packTallyVotesSmallVals function same as the tallyContract.genTallyVotesPackedVals ?
|
maci/contracts/tests/MessageProcessor.test.ts Line 148 in 724f18e
why we use toString(16) here while using just toString() elsewhere?
|
maci/contracts/tests/MaciOverflow.test.ts Line 28 in 724f18e
what kind of overflow are we testing here? |
maci/contracts/tests/MaciOverflow.test.ts Lines 54 to 55 in 724f18e
should we add how the numbers calculated in the comments? |
Lines 16 to 25 in 724f18e
I think we miss the test-hasherBenchmarks and test-maciOverflow here?
|
maci/contracts/tests/MaciOverflow.test.ts Line 30 in 724f18e
maci/contracts/tests/MACI.test.ts Line 65 in 724f18e
I tried to remove the as { x: BigNumberish; y: BigNumberish } part to make it clearer, and it still works, so I think we could remove this?
|
maci/contracts/tests/MACI.test.ts Lines 230 to 233 in 724f18e
Do you know why put the first BigInt(0) in the array, while adding other BigInt(0) in the for loop?Same as the below parts: maci/contracts/tests/MessageProcessor.test.ts Lines 85 to 88 in 724f18e
maci/contracts/tests/Poll.test.ts Lines 72 to 75 in 724f18e
maci/contracts/tests/Tally.test.ts Lines 84 to 87 in 724f18e
|
Do we test to prevent accidentally input negative numbers somewhere? |
maci/contracts/tests/MACI.test.ts Line 246 in 724f18e
another question, why we need the init() function public for poll contract? it seems to be inited once the maci contract call deployPoll() .
|
All numeric variables we use in the smart contracts are |
So you suggest we make it |
Not sure, seems unnecessary, I'll address this when I work on the test suite |
724f18e
to
d2d13a9
Compare
definitely! |
mm agree this test case is a bit vague, will refactor it when working on the test suite |
Good shout, definitely we should be as consistent as possible |
Remove unused scripts in the contracts folder, refactor and add typedoc comments to the typescript code as well as ensure we can pass custom signers to the deployment functions.
d2d13a9
to
458bc6b
Compare
I'm not sure whether make it as an |
Curious, why do we want this? |
Lines 350 to 360 in 458bc6b
Just curious about why we assign the Poseidon contracts in the deploy function arguments for other contracts deploying, such as deploySubsidy , deployTally , etc, while we deploy Poseidon and link the libraries independently in the deployMaci function?
|
I think we could add description here explaining why running for loop from 1 to 6? |
This opens up more testing scenarios, where you can deploy smart contracts from different addresses rather than all from the same. Also you could use the signer of this custom deployer class Line 20 in 458bc6b
|
So the problem with that is that we need an |
Related to #843