Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekard0 committed May 15, 2023
1 parent 68e73a3 commit d5cdc47
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
18 changes: 18 additions & 0 deletions packages/contracts/src/test/osx-versions/Migration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,23 @@

pragma solidity 0.8.17;

/*
* Migrations.sol
*
* This is a helper contract to manage and run the migrations of the Aragon OSX Protocol contracts.
* It serves as a centralized point of control for importing different versions of contracts, which
* is particularly useful for testing and development purposes.
*
* In this file, we import different versions of a contract. This allows us to test how our system
* behaves with each of these versions, and ensure backward compatibility with older versions.
*
* The contracts from the specified versions are imported and aliased as <contract-name>_<versions_name>,
* making them easy to reference in our tests and migration scripts.
*
* After importing a contract here, the contract will be compiled and TypeChain typings will be generated,
* enabling type-safe interactions with the contract in our tests.
*
*/

import {DAO as DAO_v1_0_0} from "@aragon/osx-versions/versions/v1_0_0/contracts/core/dao/DAO.sol";
import {DAO as DAO_v1_2_0} from "@aragon/osx-versions/versions/v1_2_0/contracts/core/dao/DAO.sol";
12 changes: 6 additions & 6 deletions packages/contracts/test/plugins/governance/multisig/multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,13 +775,13 @@ describe('Multisig', function () {
});
});

it('should revert if startDate is < than now', async () => {
it.only('should revert if startDate is < than now', async () => {
// set next block time & mine a block with this time.
const nextBlockTime = (await getTime()) + 500;
await ethers.provider.send('evm_mine', [nextBlockTime]);
const block1Timestamp = (await getTime()) + 12;
await ethers.provider.send('evm_mine', [block1Timestamp]);
// set next block's timestamp
const nextTimeStamp = nextBlockTime + 500;
await setTimeForNextBlock(nextTimeStamp);
const block2Timestamp = block1Timestamp + 12;
await setTimeForNextBlock(block2Timestamp);

await expect(
multisig.createProposal(
Expand All @@ -795,7 +795,7 @@ describe('Multisig', function () {
)
)
.to.be.revertedWithCustomError(multisig, 'DateOutOfBounds')
.withArgs(nextTimeStamp, 5);
.withArgs(block2Timestamp, 5);
});

it('should revert if endDate is < than startDate', async () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/contracts/test/plugins/utils/ratio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ describe('Ratio', function () {
let ratio: RatioTest;

before(async () => {
const RatioTest = new RatioTest__factory((await ethers.getSigners())[0]);
const signers = await ethers.getSigners();
const RatioTest = new RatioTest__factory(signers[0]);
ratio = await RatioTest.deploy();
});

Expand Down
5 changes: 2 additions & 3 deletions packages/contracts/test/test-utils/conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import {PermissionConditionMock} from '../../../typechain';
import {PermissionConditionMock__factory} from '../../typechain';

export async function DeployTestPermissionCondition(): Promise<PermissionConditionMock> {
const aclConditionFactory = new PermissionConditionMock__factory(
(await ethers.getSigners())[0]
);
const signers = await ethers.getSigners();
const aclConditionFactory = new PermissionConditionMock__factory(signers[0]);
const permissionCondition = await aclConditionFactory.deploy();
return permissionCondition;
}

0 comments on commit d5cdc47

Please sign in to comment.