-
Notifications
You must be signed in to change notification settings - Fork 21
[WIP]: Increase test coverage #743
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
eb06e15
ArcScem and Redeemer test coverage
ben-kaufman 37fc0d6
coverage ContributionRewardExt
ben-kaufman 1a5e736
Update fundingrequest.js
ben-kaufman 0c63876
Update schemefactory.js
ben-kaufman 4dce0f6
Update competition.js
ben-kaufman b6cd110
lint
ben-kaufman 7e173d2
redeemer test coverage
ben-kaufman 167a5c7
Move setting scheme voting params to ArcScheme
ben-kaufman b506365
Add initializeGovernance function
ben-kaufman c83d7eb
Update ArcScheme.sol
ben-kaufman 34cfe75
Fix require
ben-kaufman ed3bc62
doc
ben-kaufman 153f16b
Add arc scheme test
ben-kaufman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| pragma solidity ^0.5.17; | ||
|
|
||
| import "../controller/Avatar.sol"; | ||
| import "@daostack/infra-experimental/contracts/votingMachines/GenesisProtocol.sol"; | ||
| import "@daostack/infra-experimental/contracts/votingMachines/IntVoteInterface.sol"; | ||
| import "@openzeppelin/upgrades/contracts/Initializable.sol"; | ||
|
|
||
|
|
@@ -13,14 +14,45 @@ contract ArcScheme is Initializable { | |
| /** | ||
| * @dev _initialize | ||
| * @param _avatar the scheme avatar | ||
| * @param _votingMachine the scheme voting machine | ||
| * @param _voteParamsHash the scheme vote params | ||
| */ | ||
| function _initialize(Avatar _avatar, IntVoteInterface _votingMachine, bytes32 _voteParamsHash) internal initializer | ||
| function _initialize(Avatar _avatar) internal initializer | ||
| { | ||
| require(address(_avatar) != address(0), "Scheme must have avatar"); | ||
| avatar = _avatar; | ||
| } | ||
|
|
||
| /** | ||
| * @dev _initializeGovernance | ||
| * @param _avatar the scheme avatar | ||
| * @param _votingMachine the scheme voting machine | ||
| * @param _voteParamsHash the scheme vote params | ||
| * @param _votingParams genesisProtocol parameters - valid only if _voteParamsHash is zero | ||
| * @param _voteOnBehalf genesisProtocol parameter - valid only if _voteParamsHash is zero | ||
| */ | ||
| function _initializeGovernance( | ||
| Avatar _avatar, | ||
| IntVoteInterface _votingMachine, | ||
| bytes32 _voteParamsHash, | ||
| uint256[11] memory _votingParams, | ||
| address _voteOnBehalf | ||
| ) internal | ||
| { | ||
| require(_votingMachine != IntVoteInterface(0), "votingMachine cannot be zero"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please cover this with test |
||
| _initialize(_avatar); | ||
| votingMachine = _votingMachine; | ||
orenyodfat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| voteParamsHash = _voteParamsHash; | ||
| if (_voteParamsHash == bytes32(0)) { | ||
| //genesisProtocol | ||
| GenesisProtocol genesisProtocol = GenesisProtocol(address(_votingMachine)); | ||
| voteParamsHash = genesisProtocol.getParametersHash(_votingParams, _voteOnBehalf); | ||
| (uint256 queuedVoteRequiredPercentage, , , , , , , , , , , ,) = | ||
| genesisProtocol.parameters(voteParamsHash); | ||
| if (queuedVoteRequiredPercentage == 0) { | ||
| //params not set already | ||
| genesisProtocol.setParameters(_votingParams, _voteOnBehalf); | ||
| } | ||
| } else { | ||
| //for other voting machines | ||
| voteParamsHash = _voteParamsHash; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.