Skip to content

Commit

Permalink
lint-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Dhir committed Jan 12, 2022
1 parent 0a94173 commit 3dc494c
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion contracts/Core/parameters/child/BlockManagerParams.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "../../storage/Constants.sol";

abstract contract BlockManagerParams is ACL, IBlockManagerParams, Constants {
uint8 public maxAltBlocks = 5;
uint16 public epochLength= 300;
uint16 public epochLength = 300;
uint256 public blockReward = 100 * (10**18);
uint256 public minStake = 20000 * (10**18);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "../ACL.sol";
import "../../storage/Constants.sol";

abstract contract CollectionManagerParams is ACL, ICollectionManagerParams, Constants {
uint16 public epochLength= 300;
uint16 public epochLength = 300;
uint16 public maxTolerance = 1000;

function setEpochLength(uint16 _epochLength) external override onlyRole(GOVERNANCE_ROLE) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/Core/parameters/child/DelegatorParams.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "../ACL.sol";
import "../../storage/Constants.sol";

abstract contract DelegatorParams is ACL, IDelegatorParams, Constants {
uint16 public epochLength= 300;
uint16 public epochLength = 300;

function setEpochLength(uint16 _epochLength) external override onlyRole(GOVERNANCE_ROLE) {
// slither-disable-next-line events-maths
Expand Down
2 changes: 1 addition & 1 deletion contracts/Core/parameters/child/RandomNoManagerParams.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "../ACL.sol";
import "../../storage/Constants.sol";

abstract contract RandomNoManagerParams is ACL, IRandomNoManagerParams, Constants {
uint16 public epochLength= 300;
uint16 public epochLength = 300;

function setEpochLength(uint16 _epochLength) external override onlyRole(GOVERNANCE_ROLE) {
// slither-disable-next-line events-maths
Expand Down
2 changes: 1 addition & 1 deletion contracts/Core/parameters/child/RewardManagerParams.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "../../storage/Constants.sol";
abstract contract RewardManagerParams is ACL, IRewardManagerParams, Constants {
uint16 public penaltyNotRevealNum = 1;
uint16 public gracePeriod = 8;
uint16 public epochLength= 300;
uint16 public epochLength = 300;
uint32 public maxAge = 100 * 10000;
uint256 public blockReward = 100 * (10**18);
uint16 public maxTolerance = 1000;
Expand Down
2 changes: 1 addition & 1 deletion contracts/Core/parameters/child/StakeManagerParams.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract contract StakeManagerParams is ACL, IStakeManagerParams, Constants {
// change the commission by 3% points
uint8 public deltaCommission = 3;
uint16 public gracePeriod = 8;
uint16 public epochLength= 300;
uint16 public epochLength = 300;
uint16 public epochLimitForUpdateCommission = 100;
SlashNums public slashNums = SlashNums(500, 9500, 0);
// Slash Penalty = bounty + burned + kept
Expand Down
2 changes: 1 addition & 1 deletion contracts/Core/parameters/child/VoteManagerParams.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "../ACL.sol";
import "../../storage/Constants.sol";

abstract contract VoteManagerParams is ACL, IVoteManagerParams, Constants {
uint16 public epochLength= 300;
uint16 public epochLength = 300;
uint256 public minStake = 20000 * (10**18);

function setEpochLength(uint16 _epochLength) external override onlyRole(GOVERNANCE_ROLE) {
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ module.exports = {
username: 'razor',
project: 'razor-network',
},
};
};
6 changes: 2 additions & 4 deletions test/ACL.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ describe('Access Control Test', async () => {
await collectionManager.grantRole(assetCreatorHash, signers[0].address);
await collectionManager.createJob(25, 0, 0, 'http://testurl.com/1', 'selector/1', 'test1');
const collectionName = 'Test Collection2';
while (Number(await getState(await stakeManager.epochLength())) !== 4)
{ await mineToNextState(); }
while (Number(await getState(await stakeManager.epochLength())) !== 4) { await mineToNextState(); }
await collectionManager.createCollection(500, 0, 1, [1], collectionName);
await collectionManager.setCollectionStatus(false, 1);
await collectionManager.revokeRole(assetCreatorHash, signers[0].address);
Expand Down Expand Up @@ -342,8 +341,7 @@ describe('Access Control Test', async () => {

await collectionManager.createJob(25, 0, 0, 'http://testurl.com/1', 'selector/1', 'test1');
await collectionManager.createJob(25, 0, 0, 'http://testurl.com/2', 'selector/2', 'test2');
while (Number(await getState(await stakeManager.epochLength())) !== 4)
{ await mineToNextState(); }
while (Number(await getState(await stakeManager.epochLength())) !== 4) { await mineToNextState(); }
await collectionManager.createCollection(500, 1, 1, [1, 2], 'test');
await collectionManager.updateCollection(1, 500, 2, -2, [1, 2]);
await collectionManager.revokeRole(assetModifierHash, signers[0].address);
Expand Down
3 changes: 1 addition & 2 deletions test/helpers/testHelpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { assert } = require('chai');
const { BigNumber } = require('ethers');
var sleep = require('sleep');
const { EPOCH_LENGTH, STATE_LENGTH } = require('./constants');
const { getEpoch, toBigNumber } = require('./utils');

Expand Down Expand Up @@ -122,7 +121,7 @@ const mineToNextEpoch = async () => {
const currentBlock = await web3.eth.getBlock(currentBlockNumber);
const currentTimestamp = currentBlock.timestamp;
const currentEpoch = await getEpoch();
const nextEpochBlockTimestamp = (currentEpoch + 1) * EPOCH_LENGTH.toNumber(); //currentBlocktimestamp + epochLength
const nextEpochBlockTimestamp = (currentEpoch + 1) * EPOCH_LENGTH.toNumber(); // currentBlocktimestamp + epochLength
const diff = nextEpochBlockTimestamp - currentTimestamp;
await ethers.provider.send('evm_increaseTime', [diff]);
await ethers.provider.send('evm_mine');
Expand Down
3 changes: 1 addition & 2 deletions test/helpers/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const { BigNumber } = ethers;
const {
ONE_ETHER, EPOCH_LENGTH, NUM_STATES, MATURITIES, STATE_LENGTH,
ONE_ETHER, EPOCH_LENGTH, NUM_STATES, MATURITIES,
} = require('./constants');
var sleep = require('sleep');

const toBigNumber = (value) => BigNumber.from(value);
const tokenAmount = (value) => toBigNumber(value).mul(ONE_ETHER);
Expand Down

0 comments on commit 3dc494c

Please sign in to comment.