@@ -82,7 +82,7 @@ describe('ERC20DividendCheckpointWrapper', () => {
82
82
test ( 'should createDividend' , async ( ) => {
83
83
// Owner Address expected
84
84
const expectedOwnerResult = '0x5555555555555555555555555555555555555555' ;
85
- const token = '0x3333333333333333333333333333333333333333 ' ;
85
+ const token = '0x9999999999999999999999999999999999999999 ' ;
86
86
87
87
// Security Token Address expected
88
88
const expectedSecurityTokenAddress = '0x3333333333333333333333333333333333333333' ;
@@ -109,10 +109,13 @@ describe('ERC20DividendCheckpointWrapper', () => {
109
109
when ( mockedERC20DetailedContract . balanceOf ) . thenReturn ( instance ( mockedBalanceOfAddressMethod ) ) ;
110
110
when ( mockedBalanceOfAddressMethod . callAsync ( expectedOwnerResult ) ) . thenResolve ( expectedBalanceOfResult ) ;
111
111
112
+ const expectedDividendContractAddress = '0x4444444444444444444444444444444444444444' ;
113
+ when ( mockedContract . address ) . thenReturn ( expectedDividendContractAddress ) ;
114
+
112
115
const expectedAllowanceResult = new BigNumber ( 100 ) ;
113
116
const mockedAllowanceMethod = mock ( MockedCallMethod ) ;
114
117
when ( mockedERC20DetailedContract . allowance ) . thenReturn ( instance ( mockedAllowanceMethod ) ) ;
115
- when ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , token ) ) . thenResolve ( expectedAllowanceResult ) ;
118
+ when ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , expectedDividendContractAddress ) ) . thenResolve ( expectedAllowanceResult ) ;
116
119
117
120
when ( mockedContractFactory . getERC20DetailedContract ( token ) ) . thenResolve ( instance ( mockedERC20DetailedContract ) ) ;
118
121
@@ -179,7 +182,7 @@ describe('ERC20DividendCheckpointWrapper', () => {
179
182
verify ( mockedERC20DetailedContract . balanceOf ) . once ( ) ;
180
183
verify ( mockedBalanceOfAddressMethod . callAsync ( expectedOwnerResult ) ) . once ( ) ;
181
184
verify ( mockedERC20DetailedContract . allowance ) . once ( ) ;
182
- verify ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , token ) ) . once ( ) ;
185
+ verify ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , expectedDividendContractAddress ) ) . once ( ) ;
183
186
verify ( mockedContractFactory . getERC20DetailedContract ( token ) ) . twice ( ) ;
184
187
verify ( mockedERC20DetailedContract . decimals ) . once ( ) ;
185
188
verify ( mockedDecimalsMethod . callAsync ( ) ) . once ( ) ;
@@ -193,7 +196,7 @@ describe('ERC20DividendCheckpointWrapper', () => {
193
196
// Owner Address expected
194
197
const expectedOwnerResult = '0x5555555555555555555555555555555555555555' ;
195
198
const checkpointId = 2 ;
196
- const token = '0x3333333333333333333333333333333333333333 ' ;
199
+ const token = '0x9999999999999999999999999999999999999999 ' ;
197
200
198
201
// Security Token Address expected
199
202
const expectedSecurityTokenAddress = '0x3333333333333333333333333333333333333333' ;
@@ -220,10 +223,13 @@ describe('ERC20DividendCheckpointWrapper', () => {
220
223
when ( mockedERC20DetailedContract . balanceOf ) . thenReturn ( instance ( mockedBalanceOfAddressMethod ) ) ;
221
224
when ( mockedBalanceOfAddressMethod . callAsync ( expectedOwnerResult ) ) . thenResolve ( expectedBalanceOfResult ) ;
222
225
226
+ const expectedDividendContractAddress = '0x4444444444444444444444444444444444444444' ;
227
+ when ( mockedContract . address ) . thenReturn ( expectedDividendContractAddress ) ;
228
+
223
229
const expectedAllowanceResult = new BigNumber ( 100 ) ;
224
230
const mockedAllowanceMethod = mock ( MockedCallMethod ) ;
225
231
when ( mockedERC20DetailedContract . allowance ) . thenReturn ( instance ( mockedAllowanceMethod ) ) ;
226
- when ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , token ) ) . thenResolve ( expectedAllowanceResult ) ;
232
+ when ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , expectedDividendContractAddress ) ) . thenResolve ( expectedAllowanceResult ) ;
227
233
228
234
when ( mockedContractFactory . getERC20DetailedContract ( token ) ) . thenResolve ( instance ( mockedERC20DetailedContract ) ) ;
229
235
@@ -304,7 +310,7 @@ describe('ERC20DividendCheckpointWrapper', () => {
304
310
verify ( mockedERC20DetailedContract . balanceOf ) . once ( ) ;
305
311
verify ( mockedBalanceOfAddressMethod . callAsync ( expectedOwnerResult ) ) . once ( ) ;
306
312
verify ( mockedERC20DetailedContract . allowance ) . once ( ) ;
307
- verify ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , token ) ) . once ( ) ;
313
+ verify ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , expectedDividendContractAddress ) ) . once ( ) ;
308
314
verify ( mockedContractFactory . getERC20DetailedContract ( token ) ) . twice ( ) ;
309
315
verify ( mockedERC20DetailedContract . decimals ) . once ( ) ;
310
316
verify ( mockedDecimalsMethod . callAsync ( ) ) . once ( ) ;
@@ -318,7 +324,7 @@ describe('ERC20DividendCheckpointWrapper', () => {
318
324
// Owner Address expected
319
325
const expectedOwnerResult = '0x5555555555555555555555555555555555555555' ;
320
326
const checkpointId = 2 ;
321
- const token = '0x3333333333333333333333333333333333333333 ' ;
327
+ const token = '0x9999999999999999999999999999999999999999 ' ;
322
328
323
329
// Security Token Address expected
324
330
const expectedSecurityTokenAddress = '0x3333333333333333333333333333333333333333' ;
@@ -356,10 +362,13 @@ describe('ERC20DividendCheckpointWrapper', () => {
356
362
when ( mockedERC20DetailedContract . balanceOf ) . thenReturn ( instance ( mockedBalanceOfAddressMethod ) ) ;
357
363
when ( mockedBalanceOfAddressMethod . callAsync ( expectedOwnerResult ) ) . thenResolve ( expectedBalanceOfResult ) ;
358
364
365
+ const expectedDividendContractAddress = '0x4444444444444444444444444444444444444444' ;
366
+ when ( mockedContract . address ) . thenReturn ( expectedDividendContractAddress ) ;
367
+
359
368
const expectedAllowanceResult = new BigNumber ( 100 ) ;
360
369
const mockedAllowanceMethod = mock ( MockedCallMethod ) ;
361
370
when ( mockedERC20DetailedContract . allowance ) . thenReturn ( instance ( mockedAllowanceMethod ) ) ;
362
- when ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , token ) ) . thenResolve ( expectedAllowanceResult ) ;
371
+ when ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , expectedDividendContractAddress ) ) . thenResolve ( expectedAllowanceResult ) ;
363
372
364
373
when ( mockedContractFactory . getERC20DetailedContract ( token ) ) . thenResolve ( instance ( mockedERC20DetailedContract ) ) ;
365
374
@@ -443,7 +452,7 @@ describe('ERC20DividendCheckpointWrapper', () => {
443
452
verify ( mockedERC20DetailedContract . balanceOf ) . once ( ) ;
444
453
verify ( mockedBalanceOfAddressMethod . callAsync ( expectedOwnerResult ) ) . once ( ) ;
445
454
verify ( mockedERC20DetailedContract . allowance ) . once ( ) ;
446
- verify ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , token ) ) . once ( ) ;
455
+ verify ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , expectedDividendContractAddress ) ) . once ( ) ;
447
456
verify ( mockedContractFactory . getERC20DetailedContract ( token ) ) . twice ( ) ;
448
457
verify ( mockedERC20DetailedContract . decimals ) . once ( ) ;
449
458
verify ( mockedDecimalsMethod . callAsync ( ) ) . once ( ) ;
@@ -462,7 +471,7 @@ describe('ERC20DividendCheckpointWrapper', () => {
462
471
describe ( 'Create Dividend with Exclusions' , ( ) => {
463
472
test ( 'should createDividendWithExclusions' , async ( ) => {
464
473
// Owner Address expected
465
- const token = '0x3333333333333333333333333333333333333333 ' ;
474
+ const token = '0x9999999999999999999999999999999999999999 ' ;
466
475
const expectedOwnerResult = '0x5555555555555555555555555555555555555555' ;
467
476
468
477
// Security Token Address expected
@@ -501,10 +510,13 @@ describe('ERC20DividendCheckpointWrapper', () => {
501
510
when ( mockedERC20DetailedContract . balanceOf ) . thenReturn ( instance ( mockedBalanceOfAddressMethod ) ) ;
502
511
when ( mockedBalanceOfAddressMethod . callAsync ( expectedOwnerResult ) ) . thenResolve ( expectedBalanceOfResult ) ;
503
512
513
+ const expectedDividendContractAddress = '0x4444444444444444444444444444444444444444' ;
514
+ when ( mockedContract . address ) . thenReturn ( expectedDividendContractAddress ) ;
515
+
504
516
const expectedAllowanceResult = new BigNumber ( 100 ) ;
505
517
const mockedAllowanceMethod = mock ( MockedCallMethod ) ;
506
518
when ( mockedERC20DetailedContract . allowance ) . thenReturn ( instance ( mockedAllowanceMethod ) ) ;
507
- when ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , token ) ) . thenResolve ( expectedAllowanceResult ) ;
519
+ when ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , expectedDividendContractAddress ) ) . thenResolve ( expectedAllowanceResult ) ;
508
520
509
521
when ( mockedContractFactory . getERC20DetailedContract ( token ) ) . thenResolve ( instance ( mockedERC20DetailedContract ) ) ;
510
522
@@ -575,7 +587,7 @@ describe('ERC20DividendCheckpointWrapper', () => {
575
587
verify ( mockedERC20DetailedContract . balanceOf ) . once ( ) ;
576
588
verify ( mockedBalanceOfAddressMethod . callAsync ( expectedOwnerResult ) ) . once ( ) ;
577
589
verify ( mockedERC20DetailedContract . allowance ) . once ( ) ;
578
- verify ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , token ) ) . once ( ) ;
590
+ verify ( mockedAllowanceMethod . callAsync ( expectedOwnerResult , expectedDividendContractAddress ) ) . once ( ) ;
579
591
verify ( mockedContractFactory . getERC20DetailedContract ( token ) ) . twice ( ) ;
580
592
verify ( mockedERC20DetailedContract . decimals ) . once ( ) ;
581
593
verify ( mockedDecimalsMethod . callAsync ( ) ) . once ( ) ;
0 commit comments