diff --git a/README.md b/README.md index 101cb77..a3b819a 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ ## Events -### `MeasurementsAdded(string cid, uint roundIndex)` +### `MeasurementsAdded(string cid, uint roundIndex, address sender)` ### `RoundStart(uint roundIndex)` ### `Transfer(address indexed to, uint256 amount)` ### `TransferFailed(address indexed to, uint256 amount)` diff --git a/src/ImpactEvaluator.sol b/src/ImpactEvaluator.sol index 221b886..3ef27b3 100644 --- a/src/ImpactEvaluator.sol +++ b/src/ImpactEvaluator.sol @@ -18,7 +18,7 @@ contract ImpactEvaluator is AccessControl { uint public roundReward = 100; uint public maxStoredRounds = 1000; - event MeasurementsAdded(string cid, uint roundIndex); + event MeasurementsAdded(string cid, uint roundIndex, address sender); event RoundStart(uint roundIndex); event Transfer(address indexed to, uint256 amount); event TransferFailed(address indexed to, uint256 amount); @@ -80,7 +80,7 @@ contract ImpactEvaluator is AccessControl { maybeAdvanceRound(); uint roundIndex = currentRoundIndex(); rounds[roundIndex].measurementsCids.push(cid); - emit MeasurementsAdded(cid, roundIndex); + emit MeasurementsAdded(cid, roundIndex, msg.sender); return roundIndex; } diff --git a/test/ImpactEvaluator.t.sol b/test/ImpactEvaluator.t.sol index 32cad0a..cc88023 100644 --- a/test/ImpactEvaluator.t.sol +++ b/test/ImpactEvaluator.t.sol @@ -6,7 +6,7 @@ import "../src/ImpactEvaluator.sol"; contract ImpactEvaluatorTest is Test { event RoundStart(uint roundIndex); - event MeasurementsAdded(string cid, uint roundIndex); + event MeasurementsAdded(string cid, uint roundIndex, address sender); event Transfer(address indexed to, uint256 amount); function test_AdvanceRound() public { @@ -63,7 +63,7 @@ contract ImpactEvaluatorTest is Test { ImpactEvaluator impactEvaluator = new ImpactEvaluator(address(0x1)); assertEq(impactEvaluator.getRoundMeasurementsCids(0).length, 0); vm.expectEmit(false, false, false, true); - emit MeasurementsAdded("cid", 0); + emit MeasurementsAdded("cid", 0, address(this)); uint roundIndex = impactEvaluator.addMeasurements("cid"); assertEq(roundIndex, 0); assertEq(impactEvaluator.getRoundMeasurementsCids(0).length, 1);