|
8 | 8 | } from '@polymathnetwork/abi-wrappers';
|
9 | 9 | import ContractWrapper from '../contract_wrapper';
|
10 | 10 | import ContractFactory from '../../factories/contractFactory';
|
11 |
| -import { TxParams, GenericModuleContract, GetLogs, Subscribe } from '../../types'; |
| 11 | +import { TxParams, GenericModuleContract, GetLogs, Subscribe, ErrorCode } from '../../types'; |
12 | 12 | import { stringToBytes32 } from '../../utils/convert';
|
13 | 13 | import functionsUtils from '../../utils/functions_utils';
|
14 | 14 | import assert from '../../utils/assert';
|
@@ -83,12 +83,20 @@ export default class ModuleWrapper extends ContractWrapper {
|
83 | 83 | };
|
84 | 84 |
|
85 | 85 | public reclaimETH = async (params: TxParams) => {
|
86 |
| - assert.assert(await this.isCallerTheSecurityTokenOwner(params.txData), 'The caller must be the ST owner'); |
| 86 | + assert.assert( |
| 87 | + await this.isCallerTheSecurityTokenOwner(params.txData), |
| 88 | + ErrorCode.Unauthorized, |
| 89 | + 'The caller must be the ST owner', |
| 90 | + ); |
87 | 91 | return (await this.contract).reclaimETH.sendTransactionAsync(params.txData, params.safetyFactor);
|
88 | 92 | };
|
89 | 93 |
|
90 | 94 | public reclaimERC20 = async (params: ReclaimERC20Params) => {
|
91 |
| - assert.assert(await this.isCallerTheSecurityTokenOwner(params.txData), 'The caller must be the ST owner'); |
| 95 | + assert.assert( |
| 96 | + await this.isCallerTheSecurityTokenOwner(params.txData), |
| 97 | + ErrorCode.Unauthorized, |
| 98 | + 'The caller must be the ST owner', |
| 99 | + ); |
92 | 100 | assert.isNonZeroETHAddressHex('tokenContract', params.tokenContract);
|
93 | 101 | return (await this.contract).reclaimERC20.sendTransactionAsync(
|
94 | 102 | params.tokenContract,
|
|
0 commit comments