@@ -9,13 +9,37 @@ import { RewardsDistributorService } from './';
99
1010describe ( 'Umbrella Rewards distributor' , ( ) => {
1111 const { address : STAKE_TOKEN } = makePair ( 'STAKE_TOKEN' ) ;
12+ const { address : STAKE_TOKEN_2 } = makePair ( 'STAKE_TOKEN_2' ) ;
1213 const { address : ALICE } = makePair ( 'ALICE' ) ;
1314
1415 const REWARD_1 = makePair ( 'REWARD_1' ) . address ;
1516 const REWARD_2 = makePair ( 'REWARD_2' ) . address ;
1617
1718 const stakeTokenService = new RewardsDistributorService ( STAKE_TOKEN ) ;
1819 const stakeTokenInterface = IRewardsDistributor__factory . createInterface ( ) ;
20+ describe ( 'claimAllAvailableRewards' , ( ) => {
21+ it ( 'should properly create the transaction' , ( ) => {
22+ const tx = stakeTokenService . claimAllAvailableRewards ( {
23+ stakeTokens : [ STAKE_TOKEN , STAKE_TOKEN_2 ] ,
24+ sender : ALICE ,
25+ } ) ;
26+ expect ( tx . from ) . toEqual ( ALICE ) ;
27+ expect ( tx . to ) . toEqual ( STAKE_TOKEN ) ;
28+ expectToBeDefined ( tx . gasLimit ) ;
29+ expectToBeDefined ( tx . data ) ;
30+ expect ( tx . gasLimit . toString ( ) ) . toEqual (
31+ gasLimitRecommendations [ ProtocolAction . umbrellaClaimAllRewards ]
32+ . recommended ,
33+ ) ;
34+ const decoded = stakeTokenInterface . decodeFunctionData (
35+ 'claimAllRewards(address[],address)' ,
36+ tx . data ,
37+ ) ;
38+ expect ( decoded ) . toHaveLength ( 2 ) ;
39+ expect ( decoded [ 0 ] ) . toEqual ( [ STAKE_TOKEN , STAKE_TOKEN_2 ] ) ;
40+ expect ( decoded [ 1 ] ) . toEqual ( ALICE ) ;
41+ } ) ;
42+ } ) ;
1943 describe ( 'claimAllRewards' , ( ) => {
2044 it ( 'should properly create the transaction' , ( ) => {
2145 const tx = stakeTokenService . claimAllRewards ( {
@@ -31,7 +55,7 @@ describe('Umbrella Rewards distributor', () => {
3155 . recommended ,
3256 ) ;
3357 const decoded = stakeTokenInterface . decodeFunctionData (
34- 'claimAllRewards' ,
58+ 'claimAllRewards(address,address) ' ,
3559 tx . data ,
3660 ) ;
3761 expect ( decoded ) . toHaveLength ( 2 ) ;
@@ -56,7 +80,7 @@ describe('Umbrella Rewards distributor', () => {
5680 . recommended ,
5781 ) ;
5882 const decoded = stakeTokenInterface . decodeFunctionData (
59- 'claimSelectedRewards' ,
83+ 'claimSelectedRewards(address,address[],address) ' ,
6084 tx . data ,
6185 ) ;
6286 expect ( decoded ) . toHaveLength ( 3 ) ;
0 commit comments