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

Commit a9d145f

Browse files
committed
fix: 🐛 removing stringToKeccak256 method
1 parent 3d2dec0 commit a9d145f

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/contract_wrappers/registries/__tests__/security_token_registry_wrapper.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
weiToValue,
1919
valueToWei,
2020
packVersion,
21-
stringToKeccak256
21+
stringToBytes32
2222
} from '../../../utils/convert';
2323
import { MockedCallMethod, MockedSendMethod, getMockedPolyResponse } from '../../../test_utils/mocked_methods';
2424
import { FULL_DECIMALS, FeeType } from '../../../types';
@@ -781,7 +781,7 @@ describe('SecurityTokenRegistryWrapper', () => {
781781
const mockedParams = {
782782
feeType: FeeType.tickerRegFee
783783
};
784-
const bytes32 = stringToKeccak256("tickerRegFee");
784+
const bytes32 = stringToBytes32("tickerRegFee");
785785
// Mocked method
786786
const mockedMethod = mock(MockedSendMethod);
787787
// Stub the method

src/contract_wrappers/registries/security_token_registry_wrapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import {
4646
weiToValue,
4747
valueToWei,
4848
packVersion,
49-
stringToKeccak256,
49+
stringToBytes32,
5050
} from '../../utils/convert';
5151
import functionsUtils from '../../utils/functions_utils';
5252

@@ -1170,11 +1170,11 @@ export default class SecurityTokenRegistryWrapper extends ContractWrapper {
11701170
let feeType = '';
11711171
switch (params.feeType) {
11721172
case FeeType.stLaunchFee: {
1173-
feeType = stringToKeccak256('stLaunchFee');
1173+
feeType = stringToBytes32('stLaunchFee');
11741174
break;
11751175
}
11761176
case FeeType.tickerRegFee: {
1177-
feeType = stringToKeccak256('tickerRegFee');
1177+
feeType = stringToBytes32('tickerRegFee');
11781178
break;
11791179
}
11801180
default: {

src/utils/convert.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,3 @@ export function packVersion(major: string, minor: string, patch: string) {
7878
const packedVersion = (parseInt(major, 10) << 16) | (parseInt(minor, 10) << 8) | parseInt(patch, 10);
7979
return packedVersion;
8080
}
81-
82-
export function stringToKeccak256(value: string) {
83-
return ethers.utils.formatBytes32String(value);
84-
}

0 commit comments

Comments
 (0)