@@ -119,7 +119,9 @@ describe('OperatorRewarder', function () {
119119 await expect ( this . mock . earned ( this . delegator1 ) ) . to . eventually . eq ( ethers . parseEther ( '5' ) ) ;
120120 await expect ( this . mock . connect ( this . delegator1 ) . claimRewards ( this . delegator1 ) )
121121 . to . emit ( this . token , 'Transfer' )
122- . withArgs ( this . mock , this . delegator1 , ethers . parseEther ( '5' ) ) ;
122+ . withArgs ( this . mock , this . delegator1 , ethers . parseEther ( '5' ) )
123+ . to . emit ( this . mock , 'RewardsClaimed' )
124+ . withArgs ( this . delegator1 , ethers . parseEther ( '5' ) ) ;
123125 await expect ( this . mock . earned ( this . delegator1 ) ) . to . eventually . eq ( 0 ) ;
124126
125127 // Historical reward: 10 (seconds) * 0.5 (reward rate) = 5
@@ -139,12 +141,16 @@ describe('OperatorRewarder', function () {
139141
140142 await expect ( this . mock . connect ( this . delegator1 ) . claimRewards ( this . delegator1 ) )
141143 . to . emit ( this . token , 'Transfer' )
142- . withArgs ( this . mock , this . delegator1 , ethers . parseEther ( '2.75' ) ) ;
144+ . withArgs ( this . mock , this . delegator1 , ethers . parseEther ( '2.75' ) )
145+ . to . emit ( this . mock , 'RewardsClaimed' )
146+ . withArgs ( this . delegator1 , ethers . parseEther ( '2.75' ) ) ;
143147 await expect ( this . mock . earned ( this . delegator1 ) ) . to . eventually . eq ( 0 ) ;
144148
145149 await expect ( this . mock . connect ( this . delegator2 ) . claimRewards ( this . delegator2 ) )
146150 . to . emit ( this . token , 'Transfer' )
147- . withArgs ( this . mock , this . delegator2 , ethers . parseEther ( '2.25' ) ) ;
151+ . withArgs ( this . mock , this . delegator2 , ethers . parseEther ( '2.25' ) )
152+ . to . emit ( this . mock , 'RewardsClaimed' )
153+ . withArgs ( this . delegator2 , ethers . parseEther ( '2.25' ) ) ;
148154 await expect ( this . mock . earned ( this . delegator2 ) ) . to . eventually . eq ( 0 ) ;
149155
150156 // Historical reward: (1+9) (seconds) * 0.5 (reward rate) = 5
@@ -178,12 +184,16 @@ describe('OperatorRewarder', function () {
178184
179185 await expect ( this . mock . connect ( this . delegator1 ) . claimRewards ( this . delegator1 ) )
180186 . to . emit ( this . token , 'Transfer' )
181- . withArgs ( this . mock , this . delegator1 , ethers . parseEther ( '4.5' ) ) ;
187+ . withArgs ( this . mock , this . delegator1 , ethers . parseEther ( '4.5' ) )
188+ . to . emit ( this . mock , 'RewardsClaimed' )
189+ . withArgs ( this . delegator1 , ethers . parseEther ( '4.5' ) ) ;
182190 await expect ( this . mock . earned ( this . delegator1 ) ) . to . eventually . eq ( 0 ) ;
183191
184192 await expect ( this . mock . connect ( this . beneficiary ) . claimFee ( ) )
185193 . to . emit ( this . token , 'Transfer' )
186- . withArgs ( this . mock , this . beneficiary , ethers . parseEther ( '0.5' ) ) ;
194+ . withArgs ( this . mock , this . beneficiary , ethers . parseEther ( '0.5' ) )
195+ . to . emit ( this . mock , 'FeeClaimed' )
196+ . withArgs ( this . beneficiary , ethers . parseEther ( '0.5' ) ) ;
187197 await expect ( this . mock . unpaidFee ( ) ) . to . eventually . eq ( 0 ) ;
188198
189199 // Historical reward: 10 (seconds) * 0.5 (reward rate) - 0.5 (10% fee) = 4.5
@@ -195,10 +205,9 @@ describe('OperatorRewarder', function () {
195205 await this . operatorStaking . connect ( this . delegator1 ) . deposit ( ethers . parseEther ( '1' ) , this . delegator1 ) ;
196206 await time . increase ( 9 ) ;
197207
198- await expect ( this . mock . connect ( this . delegator1 ) . claimRewards ( this . delegator1 ) ) . to . not . emit (
199- this . token ,
200- 'Transfer' ,
201- ) ;
208+ await expect ( this . mock . connect ( this . delegator1 ) . claimRewards ( this . delegator1 ) )
209+ . to . not . emit ( this . token , 'Transfer' )
210+ . to . not . emit ( this . mock , 'RewardsClaimed' ) ;
202211
203212 // Historical reward: 0 (no reward rate)
204213 await expect ( this . mock . historicalReward ( ) ) . to . eventually . eq ( ethers . parseEther ( '0' ) ) ;
@@ -323,7 +332,9 @@ describe('OperatorRewarder', function () {
323332 // 1 more second goes by
324333 await expect ( this . mock . connect ( this . beneficiary ) . claimFee ( ) )
325334 . to . emit ( this . token , 'Transfer' )
326- . withArgs ( this . mock , this . beneficiary , ethers . parseEther ( '1.05' ) ) ;
335+ . withArgs ( this . mock , this . beneficiary , ethers . parseEther ( '1.05' ) )
336+ . to . emit ( this . mock , 'FeeClaimed' )
337+ . withArgs ( this . beneficiary , ethers . parseEther ( '1.05' ) ) ;
327338 await expect ( this . mock . unpaidFee ( ) ) . to . eventually . eq ( 0 ) ;
328339
329340 // Historical reward: (20+1) (seconds) * 0.5 (reward rate) - 1.05 (10% fee) = 9.45
@@ -355,12 +366,16 @@ describe('OperatorRewarder', function () {
355366 await timeIncreaseNoMine ( 10 ) ;
356367 await expect ( this . mock . connect ( this . beneficiary ) . claimFee ( ) )
357368 . to . emit ( this . token , 'Transfer' )
358- . withArgs ( this . mock , this . beneficiary , ethers . parseEther ( '0.5' ) ) ;
369+ . withArgs ( this . mock , this . beneficiary , ethers . parseEther ( '0.5' ) )
370+ . to . emit ( this . mock , 'FeeClaimed' )
371+ . withArgs ( this . beneficiary , ethers . parseEther ( '0.5' ) ) ;
359372
360373 await timeIncreaseNoMine ( 5 ) ;
361374 await expect ( this . mock . connect ( this . beneficiary ) . claimFee ( ) )
362375 . to . emit ( this . token , 'Transfer' )
363- . withArgs ( this . mock , this . beneficiary , ethers . parseEther ( '0.25' ) ) ;
376+ . withArgs ( this . mock , this . beneficiary , ethers . parseEther ( '0.25' ) )
377+ . to . emit ( this . mock , 'FeeClaimed' )
378+ . withArgs ( this . beneficiary , ethers . parseEther ( '0.25' ) ) ;
364379 } ) ;
365380
366381 it ( 'should not claim fee if not beneficiary' , async function ( ) {
0 commit comments