Skip to content

Commit

Permalink
add hasSucceeded instead of
Browse files Browse the repository at this point in the history
  • Loading branch information
novaknole committed Nov 4, 2024
1 parent d4cfd50 commit 4dbaadf
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Use [OpenZepplin v4.9.6](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.9.6).
- Updated hardhat configuration to use the `commons- config` networks.
- Updated hardhat configuration to use the `commons-config` networks.

## v1.4.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract ProposalMock is Proposal {
bytes memory
) external returns (uint256 proposalId) {}

function canExecute(uint256 proposalId) external view returns (bool) {}
function hasSucceeded(uint256 proposalId) external view returns (bool) {}

function customProposalParamsABI() external view returns (string memory) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract ProposalUpgradeableMock is ProposalUpgradeable {
bytes memory
) external returns (uint256 proposalId) {}

function canExecute(uint256 proposalId) external view returns (bool) {}
function hasSucceeded(uint256 proposalId) external view returns (bool) {}

function customProposalParamsABI() external view returns (string memory) {}
}
7 changes: 4 additions & 3 deletions contracts/src/plugin/extensions/proposal/IProposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ interface IProposal {
bytes memory data
) external returns (uint256 proposalId);

/// @notice Whether proposal can be executed or not.
/// @notice Whether proposal succeeded or not.
/// @dev Note that this must not include time window checks and only make a decision based on the thresholds.
/// @param proposalId The id of the proposal.
/// @return bool Returns if proposal can be executed or not.
function canExecute(uint256 proposalId) external view returns (bool);
/// @return bool Returns if proposal has been succeeded or not without including time window checks.
function hasSucceeded(uint256 proposalId) external view returns (bool);

/// @notice The human-readable abi format for extra params included in `data` of `createProposal`.
/// @dev Used for UI to easily detect what extra params the contract expects.
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/plugin/extensions/proposal/Proposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ abstract contract Proposal is IProposal, ERC165 {
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
// In addition to the current interfaceId, also support previous version of the interfaceId
// that did not include the following functions:
// `createProposal, canExecute, customProposalParamsABI`.
// `createProposal`, `hasSucceeded`, `customProposalParamsABI`.
return
_interfaceId ==
type(IProposal).interfaceId ^
IProposal.createProposal.selector ^
IProposal.canExecute.selector ^
IProposal.hasSucceeded.selector ^
IProposal.customProposalParamsABI.selector ||
_interfaceId == type(IProposal).interfaceId ||
super.supportsInterface(_interfaceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ abstract contract ProposalUpgradeable is IProposal, ERC165Upgradeable {
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
// In addition to the current interfaceId, also support previous version of the interfaceId
// that did not include the following functions:
// `createProposal, canExecute, customProposalParamsABI`.
// `createProposal`, `hasSucceeded`, `customProposalParamsABI`.
return
_interfaceId ==
type(IProposal).interfaceId ^
IProposal.createProposal.selector ^
IProposal.canExecute.selector ^
IProposal.hasSucceeded.selector ^
IProposal.customProposalParamsABI.selector ||
_interfaceId == type(IProposal).interfaceId ||
super.supportsInterface(_interfaceId);
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/executors/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function getActions() {
};
}

describe('Executor', async () => {
describe.only('Executor', async () => {
let data: any;
let executor: Executor;
let ownerAddress: string;
Expand All @@ -65,7 +65,7 @@ describe('Executor', async () => {
});

describe('ERC-165', async () => {
it('supports the `ERC-165` standard', async () => {
it.only('supports the `ERC-165` standard', async () => {
await erc165ComplianceTests(executor, signers[0]);
});

Expand Down

0 comments on commit 4dbaadf

Please sign in to comment.