Skip to content

Commit

Permalink
Merge pull request #1 from aragon/f/testing-suite
Browse files Browse the repository at this point in the history
Testing suite with unit tests
  • Loading branch information
brickpop committed Nov 16, 2023
2 parents 1b17c81 + 5019cfe commit de62b13
Show file tree
Hide file tree
Showing 8 changed files with 2,218 additions and 30 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: test

on: workflow_dispatch
on:
workflow_dispatch:
push:
paths:
- 'lib/**'
- 'script/**'
- 'src/**'
- 'tests/**'
- '.github/workflows/*.yml'

env:
FOUNDRY_PROFILE: ci
Expand Down
2 changes: 1 addition & 1 deletion src/IOptimisticTokenVoting.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.8;
pragma solidity ^0.8.17;

import {IVotesUpgradeable} from "@openzeppelin/contracts-upgradeable/governance/utils/IVotesUpgradeable.sol";
import {IDAO} from "@aragon/osx/core/dao/IDAO.sol";
Expand Down
11 changes: 5 additions & 6 deletions src/OptimisticTokenVotingPlugin.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.8;
pragma solidity ^0.8.17;

import {ERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
Expand All @@ -12,9 +12,8 @@ import {IOptimisticTokenVoting} from "./IOptimisticTokenVoting.sol";

import {ProposalUpgradeable} from "@aragon/osx/core/plugin/proposal/ProposalUpgradeable.sol";
import {PluginUUPSUpgradeable} from "@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol";
import {RATIO_BASE, _applyRatioCeiled} from "@aragon/osx/plugins/utils/Ratio.sol";
import {RATIO_BASE, _applyRatioCeiled, RatioOutOfBounds} from "@aragon/osx/plugins/utils/Ratio.sol";
import {IDAO} from "@aragon/osx/core/dao/IDAO.sol";
import {RATIO_BASE, RatioOutOfBounds} from "@aragon/osx/plugins/utils/Ratio.sol";

/// @title OptimisticTokenVotingPlugin
/// @author Aragon Association - 2023
Expand Down Expand Up @@ -79,7 +78,7 @@ contract OptimisticTokenVotingPlugin is
keccak256("UPDATE_OPTIMISTIC_GOVERNANCE_SETTINGS_PERMISSION");

/// @notice The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract.
bytes4 internal constant OPTIMISTIC_GOVERNANCE_INTERFACE_ID =
bytes4 public constant OPTIMISTIC_GOVERNANCE_INTERFACE_ID =
this.initialize.selector ^
this.getProposal.selector ^
this.updateOptimisticGovernanceSettings.selector;
Expand Down Expand Up @@ -481,11 +480,11 @@ contract OptimisticTokenVotingPlugin is
}

if (
totalVotingPower(block.number) <
totalVotingPower(block.number - 1) <
_governanceSettings.minProposerVotingPower
) {
revert MinProposerVotingPowerOutOfBounds({
limit: totalVotingPower(block.number),
limit: totalVotingPower(block.number - 1),
actual: _governanceSettings.minProposerVotingPower
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/OptimisticTokenVotingPluginSetup.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.8;
pragma solidity ^0.8.17;

import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
Expand Down

0 comments on commit de62b13

Please sign in to comment.