Skip to content

Commit

Permalink
fix miss
Browse files Browse the repository at this point in the history
  • Loading branch information
bulbozaur committed Jul 5, 2024
1 parent 157c9ff commit 01943be
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions contracts/committees/EmergencyExecutionCommittee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ contract EmergencyExecutionCommittee is HashConsensus, ProposalsList {

function _encodeEmergencyExecute(uint256 proposalId)
private
view
pure
returns (bytes memory proposalData, bytes32 key)
{
proposalData = abi.encode(ProposalType.EmergencyExecute, bytes32(proposalId));
proposalData = abi.encode(ProposalType.EmergencyExecute, proposalId);
key = keccak256(proposalData);
}

Expand Down Expand Up @@ -87,7 +87,7 @@ contract EmergencyExecutionCommittee is HashConsensus, ProposalsList {
);
}

function _encodeEmergencyResetProposalKey() internal view returns (bytes32) {
function _encodeEmergencyResetProposalKey() internal pure returns (bytes32) {
return keccak256(abi.encode(ProposalType.EmergencyReset, bytes32(0)));
}
}
14 changes: 7 additions & 7 deletions contracts/committees/ProposalsList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ contract ProposalsList {

EnumerableProposals.Bytes32ToProposalMap internal _proposals;

function getProposals(uint256 offset, uint256 limit) public returns (Proposal[] memory proposals) {
function getProposals(uint256 offset, uint256 limit) public view returns (Proposal[] memory proposals) {
bytes32[] memory keys = _proposals.orederedKeys(offset, limit);

uint256 length = keys.length;
proposals = new Proposal[](keys.length);
proposals = new Proposal[](length);

for (uint256 i = 0; i < keys.length; ++i) {
for (uint256 i = 0; i < length; ++i) {
proposals[i] = _proposals.get(keys[i]);
}
}

function getProposalAt(uint256 index) public returns (Proposal memory) {
function getProposalAt(uint256 index) public view returns (Proposal memory) {
return _proposals.at(index);
}

function getProposal(bytes32 key) public returns (Proposal memory) {
function getProposal(bytes32 key) public view returns (Proposal memory) {
return _proposals.get(key);
}

function proposalsLength() public returns (uint256) {
function proposalsLength() public view returns (uint256) {
return _proposals.length();
}

function orederedKeys(uint256 offset, uint256 limit) public returns (bytes32[] memory) {
function orederedKeys(uint256 offset, uint256 limit) public view returns (bytes32[] memory) {
return _proposals.orederedKeys(offset, limit);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/committees/TiebreakerCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contract TiebreakerCore is HashConsensus, ProposalsList {
}

function _encodeScheduleProposal(uint256 proposalId) internal pure returns (bytes memory data, bytes32 key) {
data = abi.encode(ProposalType.ScheduleProposal, data);
data = abi.encode(ProposalType.ScheduleProposal, proposalId);
key = keccak256(data);
}

Expand Down
1 change: 0 additions & 1 deletion test/scenario/tiebraker.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ contract TiebreakerScenarioTest is ScenarioTestBlueprint {
);
assert(support == quorum);

uint256 lastProposalId = EmergencyProtectedTimelock(address(_dualGovernance.TIMELOCK())).getProposalsCount();
_tiebreakerCommittee.executeSealableResume(address(_WITHDRAWAL_QUEUE));

assertEq(_WITHDRAWAL_QUEUE.isPaused(), false);
Expand Down

0 comments on commit 01943be

Please sign in to comment.