Skip to content

Commit 1ce46f0

Browse files
committed
fix: change to if/else
1 parent a52066c commit 1ce46f0

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

packages/contracts/contracts/rewards/SubgraphAvailabilityManager.sol

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,15 @@ contract SubgraphAvailabilityManager is Governed {
197197
) private {
198198
uint256 timestamp = block.timestamp;
199199

200-
// corresponding votes based on _deny for a subgraph deployment
201-
uint256[NUM_ORACLES] storage lastVoteForSubgraph = _deny
202-
? lastDenyVote[currentNonce][_subgraphDeploymentID]
203-
: lastAllowVote[currentNonce][_subgraphDeploymentID];
204-
lastVoteForSubgraph[_oracleIndex] = timestamp;
205-
206-
// clear opposite vote for a subgraph deployment if it exists
207-
uint256[NUM_ORACLES] storage oppositeVoteForSubgraph = _deny
208-
? lastAllowVote[currentNonce][_subgraphDeploymentID]
209-
: lastDenyVote[currentNonce][_subgraphDeploymentID];
210-
oppositeVoteForSubgraph[_oracleIndex] = 0;
200+
if (_deny) {
201+
lastDenyVote[currentNonce][_subgraphDeploymentID][_oracleIndex] = timestamp;
202+
// clear opposite vote for a subgraph deployment if it exists
203+
lastAllowVote[currentNonce][_subgraphDeploymentID][_oracleIndex] = 0;
204+
} else {
205+
lastAllowVote[currentNonce][_subgraphDeploymentID][_oracleIndex] = timestamp;
206+
// clear opposite vote for a subgraph deployment if it exists
207+
lastDenyVote[currentNonce][_subgraphDeploymentID][_oracleIndex] = 0;
208+
}
211209

212210
emit OracleVote(_subgraphDeploymentID, _deny, _oracleIndex, timestamp);
213211

0 commit comments

Comments
 (0)