Skip to content

Commit 0c547c4

Browse files
authored
Merge pull request #937 from graphprotocol/mde/pr937-fix-oz-n-01
fix: change OracleVote event order (OZ N-01)
2 parents fa9d0cb + 9f9db2e commit 0c547c4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/contracts/contracts/rewards/SubgraphAvailabilityManager.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,12 @@ contract SubgraphAvailabilityManager is Governed {
210210
: lastAllowVote[currentNonce][_subgraphDeploymentID];
211211
lastVoteForSubgraph[_oracleIndex] = timestamp;
212212

213+
emit OracleVote(_subgraphDeploymentID, _deny, _oracleIndex, timestamp);
214+
213215
// check if execution threshold is reached, if it is call the RewardsManager
214216
if (checkVotes(_subgraphDeploymentID, _deny)) {
215217
rewardsManager.setDenied(_subgraphDeploymentID, _deny);
216218
}
217-
218-
emit OracleVote(_subgraphDeploymentID, _deny, _oracleIndex, timestamp);
219219
}
220220

221221
/**

packages/contracts/test/rewards/subgraphAvailability.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ describe('SubgraphAvailabilityManager', () => {
283283
.to.emit(rewardsManager, 'RewardsDenylistUpdated')
284284
.withArgs(subgraphDeploymentID1, tx.blockNumber)
285285

286+
// check events order
287+
const receipt = await tx.wait()
288+
expect(receipt.events[0].event).to.be.equal('OracleVote')
289+
const rewardsManangerEvent = rewardsManager.interface.parseLog(receipt.logs[1]).name
290+
expect(rewardsManangerEvent).to.be.equal('RewardsDenylistUpdated')
291+
286292
// check that subgraph is denied
287293
expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.true
288294

0 commit comments

Comments
 (0)