Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit 5d941fe

Browse files
author
Victor Wiebe
committed
feat: add asssertion, operator data cannot be 0 in operator methods
1 parent 1d2d6d1 commit 5d941fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/contract_wrappers/tokens/security_token_wrapper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,7 @@ export default class SecurityTokenWrapper extends ERC20TokenWrapper {
12901290
public operatorRedeemByPartition = async (params: OperatorRedeemByPartitionParams) => {
12911291
await this.checkBalanceFromGreaterThanValue((await this.web3Wrapper.getAvailableAddressesAsync())[0], params.value);
12921292
assert.isNonZeroETHAddressHex('TokenHolder', params.tokenHolder);
1293+
assert.assert(params.operatorData.length > 0, 'Operator data cannot be 0');
12931294
assert.isValidPartition(params.partition);
12941295
return (await this.contract).operatorRedeemByPartition.sendTransactionAsync(
12951296
params.partition,
@@ -1423,6 +1424,7 @@ export default class SecurityTokenWrapper extends ERC20TokenWrapper {
14231424
public operatorTransferByPartition = async (params: OperatorTransferByPartitionParams) => {
14241425
assert.isETHAddressHex('To', params.to);
14251426
assert.isETHAddressHex('From', params.from);
1427+
assert.assert(params.operatorData.length > 0, 'Operator data cannot be 0');
14261428
assert.isValidPartition(params.partition);
14271429
return (await this.contract).operatorTransferByPartition.sendTransactionAsync(
14281430
stringToBytes32(params.partition),

0 commit comments

Comments
 (0)