@@ -26,6 +26,7 @@ import {
26
26
Subscribe ,
27
27
GetLogs ,
28
28
Perm ,
29
+ ErrorCode ,
29
30
} from '../../../types' ;
30
31
import { numberToBigNumber , dateToBigNumber , stringToBytes32 , valueToWei } from '../../../utils/convert' ;
31
32
@@ -189,7 +190,11 @@ export default class ERC20DividendCheckpointWrapper extends DividendCheckpointWr
189
190
} ;
190
191
191
192
public createDividend = async ( params : CreateDividendParams ) => {
192
- assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
193
+ assert . assert (
194
+ await this . isCallerAllowed ( params . txData , Perm . Admin ) ,
195
+ ErrorCode . Unauthorized ,
196
+ 'Caller is not allowed' ,
197
+ ) ;
193
198
await this . checkIfDividendCreationIsValid (
194
199
params . expiry ,
195
200
params . maturity ,
@@ -211,7 +216,11 @@ export default class ERC20DividendCheckpointWrapper extends DividendCheckpointWr
211
216
} ;
212
217
213
218
public createDividendWithCheckpoint = async ( params : CreateDividendWithCheckpointParams ) => {
214
- assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
219
+ assert . assert (
220
+ await this . isCallerAllowed ( params . txData , Perm . Admin ) ,
221
+ ErrorCode . Unauthorized ,
222
+ 'Caller is not allowed' ,
223
+ ) ;
215
224
await this . checkIfDividendCreationIsValid (
216
225
params . expiry ,
217
226
params . maturity ,
@@ -235,7 +244,11 @@ export default class ERC20DividendCheckpointWrapper extends DividendCheckpointWr
235
244
} ;
236
245
237
246
public createDividendWithExclusions = async ( params : CreateDividendWithExclusionsParams ) => {
238
- assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
247
+ assert . assert (
248
+ await this . isCallerAllowed ( params . txData , Perm . Admin ) ,
249
+ ErrorCode . Unauthorized ,
250
+ 'Caller is not allowed' ,
251
+ ) ;
239
252
await this . checkIfDividendCreationIsValid (
240
253
params . expiry ,
241
254
params . maturity ,
@@ -262,7 +275,11 @@ export default class ERC20DividendCheckpointWrapper extends DividendCheckpointWr
262
275
public createDividendWithCheckpointAndExclusions = async (
263
276
params : CreateDividendWithCheckpointAndExclusionsParams ,
264
277
) => {
265
- assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
278
+ assert . assert (
279
+ await this . isCallerAllowed ( params . txData , Perm . Admin ) ,
280
+ ErrorCode . Unauthorized ,
281
+ 'Caller is not allowed' ,
282
+ ) ;
266
283
await this . checkIfDividendCreationIsValid (
267
284
params . expiry ,
268
285
params . maturity ,
0 commit comments