Skip to content

Commit

Permalink
swap function params
Browse files Browse the repository at this point in the history
  • Loading branch information
maxaleks committed Jun 18, 2019
1 parent a70ddb1 commit f7a3745
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
5 changes: 3 additions & 2 deletions contracts/VotingToManageEmissionFunds.sol
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,14 @@ contract VotingToManageEmissionFunds is VotingTo {
uint256 _emissionReleaseTime, // unix timestamp
uint256 _emissionReleaseThreshold, // seconds
uint256 _distributionThreshold, // seconds
address _emissionFunds,
uint256 _minBallotDuration
uint256 _minBallotDuration, // seconds
address _emissionFunds
) public onlyOwner {
require(_emissionReleaseTime > getTime());
require(_emissionReleaseThreshold > 0);
require(_distributionThreshold > ballotCancelingThreshold());
require(_emissionReleaseThreshold > _distributionThreshold);
require(_minBallotDuration < _distributionThreshold);
require(_emissionFunds != address(0));
_init(_minBallotDuration);
_setNoActiveBallotExists(true);
Expand Down
4 changes: 2 additions & 2 deletions migrations/2_deploy_contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ module.exports = function(deployer, network, accounts) {
demoMode ? moment.utc().add(10, 'minutes').unix() : moment.utc().add(3, 'months').unix(),
demoMode ? 3600 : 7776000, // emissionReleaseThreshold: 1 hour for demo, 3 months for production
demoMode ? 1500 : 604800, // distributionThreshold: 25 minutes for demo, 7 days for production
emissionFunds.address,
minBallotDuration
minBallotDuration,
emissionFunds.address
);

// Initialize ProxyStorage
Expand Down
18 changes: 9 additions & 9 deletions test/voting_to_manage_emission_funds_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,23 @@ contract('VotingToManageEmissionFunds [all features]', function (accounts) {
emissionReleaseTime,
emissionReleaseThreshold,
distributionThreshold,
emissionFunds.address,
minBallotDuration,
emissionFunds.address,
{from: accounts[8]}
).should.be.rejectedWith(ERROR_MSG);
await voting.init(
emissionReleaseTime,
emissionReleaseThreshold,
300,
emissionFunds.address,
minBallotDuration
minBallotDuration,
emissionFunds.address
).should.be.rejectedWith(ERROR_MSG);
await voting.init(
emissionReleaseTime,
emissionReleaseThreshold,
distributionThreshold,
emissionFunds.address,
minBallotDuration
minBallotDuration,
emissionFunds.address
).should.be.fulfilled;

rewardByBlock = await RewardByBlock.new();
Expand Down Expand Up @@ -165,8 +165,8 @@ contract('VotingToManageEmissionFunds [all features]', function (accounts) {
emissionReleaseTime,
emissionReleaseThreshold,
distributionThreshold,
emissionFunds.address,
minBallotDuration
minBallotDuration,
emissionFunds.address
).should.be.rejectedWith(ERROR_MSG);
});
});
Expand Down Expand Up @@ -1055,8 +1055,8 @@ contract('VotingToManageEmissionFunds [all features]', function (accounts) {
emissionReleaseTime,
emissionReleaseThreshold,
distributionThreshold,
emissionFunds.address,
minBallotDuration
minBallotDuration,
emissionFunds.address
).should.be.fulfilled;
});
it('may only be called by ProxyStorage', async () => {
Expand Down
14 changes: 7 additions & 7 deletions test/voting_to_manage_emission_funds_upgrade_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,23 @@ contract('VotingToManageEmissionFunds upgraded [all features]', function (accoun
emissionReleaseTime,
emissionReleaseThreshold,
distributionThreshold,
emissionFunds.address,
minBallotDuration,
emissionFunds.address,
{from: accounts[8]}
).should.be.rejectedWith(ERROR_MSG);
await voting.init(
emissionReleaseTime,
emissionReleaseThreshold,
300,
emissionFunds.address,
minBallotDuration
minBallotDuration,
emissionFunds.address
).should.be.rejectedWith(ERROR_MSG);
await voting.init(
emissionReleaseTime,
emissionReleaseThreshold,
distributionThreshold,
emissionFunds.address,
minBallotDuration
minBallotDuration,
emissionFunds.address
).should.be.fulfilled;

rewardByBlock = await RewardByBlock.new();
Expand Down Expand Up @@ -172,8 +172,8 @@ contract('VotingToManageEmissionFunds upgraded [all features]', function (accoun
emissionReleaseTime,
emissionReleaseThreshold,
distributionThreshold,
emissionFunds.address,
minBallotDuration
minBallotDuration,
emissionFunds.address
).should.be.rejectedWith(ERROR_MSG);
});
});
Expand Down

0 comments on commit f7a3745

Please sign in to comment.