mirror of
https://github.com/tornadocash/tornado-aggregator.git
synced 2024-12-04 23:15:03 +01:00
fix bugs
This commit is contained in:
parent
e4f463f876
commit
628a023fc6
@ -18,16 +18,10 @@ contract GovernanceAggregator {
|
|||||||
Governance.ProposalState state;
|
Governance.ProposalState state;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllProposals(
|
function getAllProposals(Governance governance) public view returns (Proposal[] memory proposals) {
|
||||||
Governance governance,
|
proposals = new Proposal[](governance.proposalCount());
|
||||||
uint256 from,
|
|
||||||
uint256 to
|
|
||||||
) public view returns (Proposal[] memory proposals) {
|
|
||||||
uint256 proposalCount = governance.proposalCount();
|
|
||||||
to = to == 0 ? proposalCount : to;
|
|
||||||
proposals = new Proposal[](proposalCount);
|
|
||||||
|
|
||||||
for (from; from < to; from++) {
|
for (uint256 i = 0; i < proposals.length; i++) {
|
||||||
(
|
(
|
||||||
address proposer,
|
address proposer,
|
||||||
address target,
|
address target,
|
||||||
@ -37,9 +31,9 @@ contract GovernanceAggregator {
|
|||||||
uint256 againstVotes,
|
uint256 againstVotes,
|
||||||
bool executed,
|
bool executed,
|
||||||
bool extended
|
bool extended
|
||||||
) = governance.proposals(from);
|
) = governance.proposals(i + 1);
|
||||||
|
|
||||||
proposals[from] = Proposal({
|
proposals[i] = Proposal({
|
||||||
proposer: proposer,
|
proposer: proposer,
|
||||||
target: target,
|
target: target,
|
||||||
startTime: startTime,
|
startTime: startTime,
|
||||||
@ -48,7 +42,7 @@ contract GovernanceAggregator {
|
|||||||
againstVotes: againstVotes,
|
againstVotes: againstVotes,
|
||||||
executed: executed,
|
executed: executed,
|
||||||
extended: extended,
|
extended: extended,
|
||||||
state: governance.state(from)
|
state: governance.state(i + 1)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user