Skip to content
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

Testing suite with unit tests #1

Merged
merged 6 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading